在Python中同时测试多个标志的不同方法

# 在Python中同时测试多个标志的不同方法

x, y, z = 0, 1, 0

# 方法1
if x == 1 or y == 1 or z == 1:
    print('passed')
# 方法2
if 1 in (x, y, z):
    print('passed')

# 方法3
if x or y or z:
    print('passed')

# 方法4
if any((x, y, z)):
    print('passed')