在Python中,具有特殊功能的标识符称为关键字。关键字是Python语言自己已经使用的了,不允许开发者自己定义和关键字相同名字的标识符。本文主要介绍Python False 关键字(keyword)。

Python 关键字

例如:

打印输出比较结果“5大于6”:

print(5 > 6)

1、定义和用法

关键字False是布尔值,是比较操作的结果。

关键字False与0相同(True与1相同)。

2、使用示例

例如:

其他返回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])

3、相关函数

True关键字

Python运算符教程

Python 关键字

推荐文档