Python 2: Conditional statement behaviour of lists with greater/smaller [duplicate]

So you are using Python2, where you can compare between list and strings and numbers. This helps to sort them out.


=> True

However since Python3 this has been removed.


Traceback (most recent call last):
  File "python", line 1, in <module>
TypeError: unorderable types: list() > int() 

Hope that explains, why list has been made to be greater than number is purely subjective and depends on the creators.

Browse More Popular Posts

Leave a Comment