Python 使用工具总结

1.比较两个list大小:operator模块

operator.lt(a, b)
operator.le(a, b)
operator.eq(a, b)
operator.ne(a, b)
operator.ge(a, b)
operator.gt(a, b)
operator.__lt__(a, b)
operator.__le__(a, b)
operator.__eq__(a, b)
operator.__ne__(a, b)
operator.__ge__(a, b)
operator.__gt__(a, b)

2.排序 :heapq模块

猜你喜欢

转载自www.cnblogs.com/peanutk/p/10088408.html