摘要: python中自定义排序函数 Python内置的 sorted()函数可对list进行排序: >>>sorted([36, 5, 12, 9, 21]) [5, 9, 12, 21, 36] 但 sorted()也是一个高阶函数,它可以接收一个比较函数来实现自定义排序,比较函数的定义是,传入两个待比 阅读全文
posted @ 2018-11-20 09:48 瀛洲小李 阅读(152) 评论(0) 推荐(0) 编辑