Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print "100" < "2" # True
- print "5" > "9" # False
- print "100" < 2 # False
- print 100 < "2" # True
- print 5 > "9" # False
- print "5" > 9 # True
- print [] > float('inf') # True
- print () > [] # True
- >>> 5 < 'foo'
- True
- >>> 5 < (1, 2)
- True
- >>> 5 < {}
- True
- >>> 5 < [1, 2]
- True
- >>> [1, 2] > 'foo' # 'list' < 'str'
- False
- >>> (1, 2) > 'foo' # 'tuple' > 'str'
- True
- >>> class Foo(object): pass
- >>> class Bar(object): pass
- >>> Bar() < Foo()
- True
- >>> class Foo: pass # old-style
- >>> class Bar(object): pass # new-style
- >>> Bar() < Foo()
- False
- >>> '10' > 5
- Traceback (most recent call last):
- File "<pyshell#0>", line 1, in <module>
- '10' > 5
- TypeError: unorderable types: str() > int()
Add Comment
Please, Sign In to add comment