Silly question (perl programmer here)
How do I do
if x == 1 or x == 2:
execute this
in python?
OR in python?
Re: OR in python?
Figures it out 10 seconds later
if (x == 1) | (x==2):
if (x == 1) | (x==2):
Re: OR in python?
You could have it written exactly as in the question
In your answer you actually do a bitwise combination of to boolean values.
Code: Select all
if x == 1 or x == 2: