What is the output?
x = 5 print(1 < x < 3, 1 < x > 3)
- True True
- False True
- False False
- True False
Python chains comparisons: 1 < x < 3 means 1 < x and x < 3 (False), and 1 < x > 3 means 1 < x and x > 3 (True).
Play Problem Solving ▸
x = 5 print(1 < x < 3, 1 < x > 3)