代码点读机 / Python / ==

== Python · 运算符

比较两边是否相等,返回 True 或 False。

怎么用

a == b

小例子

print(3 == 3)
print(3 == 4)

运行结果

True
False

官方文档:https://docs.python.org/zh-cn/3/reference/expressions.html#comparisons

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