I just started with python 3 days ago. During programming, I came across a strange situation.
a = [ [5, [[1, 1, None], [None, None, None], [None, None, None]]], [5, [[1, None, 1], [None, None, None], [None, None, None]]] ]
max(a) gives me
Traceback (last last call): File "", line 1, in TypeError: unorderable types: NoneType ()> int ()
But if I try
a = [ [5, [[1, 1, None], [None, None, None], [None, None, None]]], [5.1, [[1, None, 1], [None, None, None], [None, None, None]]] ]
max(a) displays
[5.1, [[1, None, 1], [None, None, None], [None, None, None]]]
Any specific reason for this behavior?
Update 1: I tried something else
a = [[5, [[1,2], [3,4]]],[5,[[3,4],[5,10]]],[5,[[5,6],[7,8]]]]
and max(a) is [5, [[5, 6], [7, 8]]] My doubt is why the error is not displayed in this case?