Advertisement
Guest User

Untitled

a guest
Oct 14th, 2015
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. class Napis:
  2.     def __init__(self, s):
  3.         self._s = s
  4.     def __lt__(self, o):
  5.         return len(self._s) < len(o._s)
  6.     def __repr__(self):
  7.         return str(self._s)
  8. napisy = (Napis("aaaaaaaa"), Napis("a"), Napis("aaa"), Napis("bb"))
  9. print sorted(napisy)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement