Python中运算符连用

代码:
if 3 > 2 < 4:
    print(True)

意思就是:2小于3和2小于4就等于True

代码:
if 4 < 5 > 3:
    print(True)

意思就是:5大于4和5大于3就等于True

返回结果:
True
True

  

posted @ 2021-07-09 16:50  lucky_tomato  阅读(180)  评论(0编辑  收藏  举报