python3中没有cmp的函数,所以我们要导入opreater库,用库中比较函数来比较。
首先教大家几个英文:
大于:greater than
小于:less than
等于:equal
所以库中的大于就是gt,小于lt,等于eq,
import operator as op
if (op.gt("123","100")):
print("greater than")
if(op.lt("100","123")):
print("less than")
python3中没有cmp的函数,所以我们要导入opreater库,用库中比较函数来比较。
首先教大家几个英文:
大于:greater than
小于:less than
等于:equal
所以库中的大于就是gt,小于lt,等于eq,
import operator as op
if (op.gt("123","100")):
print("greater than")
if(op.lt("100","123")):
print("less than")