Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import namedtuple
- class Rectangle(namedtuple("Rectangle", "width height")):
- @property
- def area(self):
- return self.width * self.height
- rect = Rectangle(5, 6)
- print rect.area
Advertisement
Add Comment
Please, Sign In to add comment