需要澄清是否与and运算符相关的条件

时间:2019-04-12 13:13:04

标签: python python-3.x

如果我错了,请纠正我:

a = "Disabled"

if a == "Disabled" and "Disable":
    print('True')
else:
    print('False')

if a is "Disabled" or "Disable"

1 个答案:

答案 0 :(得分:0)

你想写的是

if a == "Disabled" or a == "Disable":

其他选项是

if a in ("Disabled", "Disable):