Sourcery refactoring id:
Combine two compares on same value into a chained compare
if 1 < b and b < 3: print("b is between 1 and 3")
if 1 < b < 3: print("b is between 1 and 3")
Two compare operations on the same value can be chained together. This is described in detail in the Python comparison docs.
Chaining compares is how they are written in mathematics and makes them easier to read.