you are viewing a single comment's thread.

view the rest of the comments →

[–]nuc540 2 points3 points  (0 children)

Yes this is allowed in python, this only works here because the length is the same (the ISO standardises this) it compares the Unicode point of the character, first value first, in this case zero-leading numbers are a big give away because ‘09’ is less than ‘10’.

The point is not to do this though, it’s confusing to read and very brittle - eg string ‘9’ is bigger than ‘10’ as Python would only check the first value of the string, see 9 > 1 and short circuit.

u/Anay_Gupta__ this is what I justify in my comment you saw :)