Python False 關鍵字

實例

打印比較 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])

運行實例

相關頁面

True 關鍵字

請在我們的 Python 運算符 中學習更多有關比較的知識。