[Solved] == vs. in operator in Python [duplicate]

[ad_1]

if 0 in (result1, result2, result3):

is equivalent to:

if result1==0 or result2==0 or result3==0:

What you want is this:

if (0,0,0) == (result1, result2, result3):

Which is equivalent to:

if result1==0 and result2==0 and result3==0:

You could actually even do this:

if result1==result2==result3==0:

since you’re checking to see if all 3 variables equal the same thing.

1

[ad_2]

solved == vs. in operator in Python [duplicate]