美文网首页
040 Python语法之operator模块

040 Python语法之operator模块

作者: Luo_Luo | 来源:发表于2017-09-12 11:34 被阅读0次

操作符工具类

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  等价   !=

相关文章

网友评论

      本文标题:040 Python语法之operator模块

      本文链接:https://www.haomeiwen.com/subject/cehcsxtx.html