# Different ways to test multiple # flags at once in Python x, y, z = 0, 1, 0 if x == 1 or y == 1 or z == 1: print('1-passed') if 1 in (x, y, z): print('2-passed') # These only test for truthiness: if x or y or z: print('3-passed') if any((x, y, z)): print('4-passed') --------------------------------------------- 1-passed 2-passed 3-passed 4-passed