PythonStudy——比较运算符 Comparison operator

 

1.运算结果为bool类型

print(3 > 5)

Output:

False

 2.可以连比

num = 10
print(1 < num < 20)
# 与之上的等价写法是: print(num > 1 or num < 20)

Output:
True

 

posted @ 2019-04-15 21:02  挺锅锅  阅读(161)  评论(0编辑  收藏  举报