python中3==3 is not True的返回值为什么是True

python中3==3 is not True的返回值为什么是True
从董付国那本书上遇到的问题

你是什么版本的? 我的版本3.8.8上说语法错误:
3==3 is not True
SyntaxError: "is not" with a literal. Did you mean "!="?

img

>>> (3==3 ) is not True
False
>>> 3==3 is not True
True
>>> 3 is not True
True
>>> 3==True
False

其实就等价于
3==3!=1
问题的关键在于,python是允许连不等式的,比如判断n在0到10之间,就可以这样写 if 0<n<10:
c语言没有连续不等判断的支持,所以会从头到尾的去运算,然后把运算结果再与后面的条件做对比
python则不是这样的,它会直接把每一项和它的后一项做对比,而不是把前面的结果与后面做对比
-=-=-=
另:当连不等式同时成立时,结果为True,有任何一项不成立时,结果为False