Sep 17, 2018

Multiple chain comparison in Python

n = 10
result = 1 < n < 20
print(result)

# True

result = 1 > n <= 9
print(result)

# False