z=2
y=1
I have the expression:
x = y<z or z>y and y>z or z<y
Can somebody explain how this evaluates to True?
z=2
y=1
I have the expression:
x = y<z or z>y and y>z or z<y
Can somebody explain how this evaluates to True?
z=2
y=1
y<z(True) or z>y(True) and y>z(False) or z<y(False)
True OR True AND False OR False
True AND False
will be evaluated first(as AND
has higher precedence over OR
) ;
they come out to be False
Now, True OR True AND False OR False
reduces to:
True OR False OR False
So, the final output will be True