摘要:
Python内置的 sorted()函数可对list进行排序: >>>sorted([36, 5, 12, 9, 21]) [5, 9, 12, 21, 36] 但 sorted()也是一个高阶函数,它可以接收一个比较函数来实现自定义排序,比较函数的定义是,传入两个待比较的元素 x, y,如果 x 阅读全文
posted @ 2016-02-04 14:14
o小小程序猿o
阅读(761)
评论(0)
推荐(0)