Why is print(0<0<2) false?
Which does it compute first 0<0 and then false<2 or the entire statement together?
Also, why is print(False<2) True?
Also, print(False<True) True?
Why is print(0<0<2) false?
Which does it compute first 0<0 and then false<2 or the entire statement together?
Also, why is print(False<2) True?
Also, print(False<True) True?
Why is
print(0<0<2)false?
wim linked a really interesting post that answers this question ( here )
why is
print(False<2)True?
Because the < operator evaluates False as 0 in this specific circumstance
[Why is]
print(False<True)True?
Because False is evaluated as 0 and True is evaluated as 1. Therefor 0<1 is true