在python中运转发明:
>>> 1 in [1,0] == True # This is strangeFalse >>> False
Python实际上在这里运用比较运算符链接。表达式被翻译成
(1 in [1, 0]) and ([1, 0] == True)
这显然是False。
这也适用于像如许的表达式
a < b < c
转化为
(a < b) and (b < c)
以上就是为什么1 in [1,0] == True实行结果是False的细致内容,更多请关注ki4网别的相干文章!