Py学习  »  Python

Python中“in”和“==”的优先级[重复]

nugget_boi • 4 年前 • 725 次点击  

假设我有以下代码行:

print("valley" in "hillside" == False)

因为 in == True 作为输出。

False .

我注意到在周围加括号 "valley" in "hillside" 结果 真的

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/56970
 
725 次点击  
文章 [ 2 ]  |  最新文章 4 年前