Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Napis:
- def __init__(self, s):
- self._s = s
- def __lt__(self, o):
- return len(self._s) < len(o._s)
- def __repr__(self):
- return str(self._s)
- napisy = (Napis("aaaaaaaa"), Napis("a"), Napis("aaa"), Napis("bb"))
- print sorted(napisy)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement