深入Python(1): 字典排序 关于sort()、reversed()、sorted()、cmp()等
生活随笔
收集整理的這篇文章主要介紹了
深入Python(1): 字典排序 关于sort()、reversed()、sorted()、cmp()等
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
一、最不沾邊的cmp()
cmp(x, y)Compare the two objects x and y and return an integer according to the outcome. The return value is negative if x < y, zero if x == y and strictly positive if x > y.
如:
總結(jié)
以上是生活随笔為你收集整理的深入Python(1): 字典排序 关于sort()、reversed()、sorted()、cmp()等的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 深入Python(3): and、or以
- 下一篇: 深入Python(2): __init_