Python 关键字 or
定义和用法
or关键字是一个逻辑运算符。
逻辑运算符用于组合条件语句。
如果其中一个语句为True,则返回True,否则返回False。
更多实例
实例
or在if语句中使用关键字:
if 5 > 3 or 5 > 10:
print("At least one of the statements are True")
else:
print("None of the statements are True")
运行实例»相关页面
关键字and,not也是逻辑运算符。
在Python 运算符教程中阅读有关运算符的更多信息。 