Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Wardrobe:
- def __init__(self, *args):
- self.args = list(args)
- def __str__(self):
- return ' '.join(self.args)
- def __lt__(self, other):
- if type(self) == JustWardrobe and type(other) == MagicWardrobe:
- return True
- if type(self) == type(other):
- return len(self.args) < len(other.args)
- else:
- False
- def __gt__(self, other):
- if type(other) == JustWardrobe and type(self) == MagicWardrobe:
- return True
- if type(self) == type(other):
- return len(self.args) > len(other.args)
- else:
- False
- def __eq__(self, other):
- if type(self) == type(other):
- return len(self.args) == len(other.args)
- class JustWardrobe(Wardrobe):
- def __str__(self):
- return ', '.join(self.args).capitalize() + '.'
- class MagicWardrobe(Wardrobe):
- def __str__(self):
- self.args.sort()
- return ', '.join(self.args).title() + '.'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement