Python False 关键字
Python基础 2022-06-06 16:26:04小码哥的IT人生shichen
Python False 关键字
实例
打印比较 5 大于 6 的结果:
print(5 > 6)
完整实例:
print(5 > 6)
定义和用法
False 关键字是布尔值,是比较运算的结果。
False 关键字等同于 0(True 等同于 1)。
更多实例
示例代码:
其他返回 False 的比较:
print(5 > 6)
print(4 in [1,2,3])
print("hello" is "goodbye")
print(5 == 6)
print(5 == 6 or 6 == 7)
print(5 == 6 and 6 == 7)
print("hello" is not "hello")
print(not(5 == 5))
print(3 not in [1,2,3])
完整实例:
print(5 > 6)
print(4 in [1,2,3])
print("hello" is "goodbye")
print(5 == 6)
print(5 == 6 or 6 == 7)
print(5 == 6 and 6 == 7)
print("hello" is not "hello")
print(not(5 == 5))
print(3 not in [1,2,3])