I'm newbie in python. I have a three variables x
, y
, z
as a int
. I have comparison three variables in if
condition. I'm confused about following code result.
The expression x < y <= z
evaluates to false.
Let's assume x = 10
, y = 5
and z = 0
. if x < y
become False, then False <= 0
become True. but output is False. Why?
My python script:
#!/usr/bin/python
x = 10
y = 5
z = 0
if (x < y < z):
print"True"
else:
print"False"