Why is the boolean expression “1 in (1, 2, 3) == True” False? [duplicate]
问题 This question already has answers here : Why does (1 in [1,0] == True) evaluate to False? [duplicate] (1 answer) Why does the expression 0 < 0 == 0 return False in Python? (9 answers) Closed 3 years ago . Why does the statement 1 in (1, 2, 3) == True return False in Python? Is the operator priority in Python ambiguous? 回答1: Because, per the documentation on operator precedence: Note that comparisons, membership tests, and identity tests, all have the same precedence and have a left-to-right