How I define OR in code?
I need write something like this:
if var == 1 or 2 or 3:
Thank you for answer.
You need to make all of the comparisons:
if var == 1 or var == 2 or var == 3:
For the same conditions, you could also do:
if var >= 1 and var <= 3:
And one more option:
if var in [1, 2, 3]:
All three statements are equivalent.
That's exactly what I needed!
Thank you very much