python3.*版本中取消了数值之间的比较:cmp(x, y)。取而代之的是 (x > y) - (x < y) 因为python中 false 为 0, true 为 1. 转载于:https://www.cnblogs.com/DennyZhao/p/8601037.html