Is `a<b<c` valid python?

后端 未结 2 1163
失恋的感觉
失恋的感觉 2020-12-03 07:12

I was curious to see if I could use this a as a conditional without using the standard a. So I tried it out and my test r

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-03 08:05

    Python chains relational operators "naturally". Note that Python's relational operators include in and is (and their negatives), which can lead to some surprising results when mixing them with the symbolic relational operators.

提交回复
热议问题