Is there a way to write an iff statement (i.e., if and only if) in Python?
I want to use it like in
for i in range(x)
iff x%2==0 and x%i==0:
However, there isn't any iff statement in Python. Wikipedia defines the truth table for iff as this:
a | b | iff a and b
-----------------------
T | T | T
T | F | F
F | T | F
F | F | T
How do I accomplish this in Python?
