040 Python语法之operator模块

import operator

a=10
b=20
print(operator.lt(a,b)) #lt  等价 <
print(operator.le(a,b)) #le  等价于<=
print(operator.ge(a,b)) # ge  等价 >=
print(operator.gt(a,b))#  gt  等价 >
print(operator.eq(a,b))# eq   等价    ==
print(operator.ne(a,b))#   ne  等价   !=
发布了151 篇原创文章 · 获赞 26 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/runnoob_1115/article/details/102952369