如何在Python 3中使用==
运算符?
==
符号被定义为等号运算符。如果两边的表达式相等,则返回true,如果它们不相等,则返回false。
>>> (10+2) == 12
True
>>> 5*5 == 5**2
True
>>> (10/3) == 3
False
>>> 'computer' == "computer"
True
>>> 'COMPUTER'.lower () == 'computer'
True
更多Python相关文章,请阅读:Python 教程