代码点读机 / Python / True

True Python · 关键字

布尔真值,像开关的‘开’档;注意首字母大写。

怎么用

变量 = True

小例子

print(3 > 2)
print(True and False)

运行结果

True
False

官方文档:https://docs.python.org/zh-cn/3/library/constants.html#True

在代码里遇到不认识的词?打开代码点读机,点一下就懂 → ← Python全部词条