课程
/后端开发
/Python
/python进阶
为何是:sorted([3,4,1,2,5,4,9,],cmp_ignore_case)形式
而不是:sorted(cmp_ignore_case,[3,4,1,2,5,4,9,])形式
2016-02-19
源自:python进阶 2-7
正在回答
这个是Python参考文档的一部分
sorted(iterable[, cmp[, key[, reverse]]])
Return a new sorted list from the items in iterable.
The optional arguments cmp, key, and reverse have the same meaning as those for the list.sort() method (described in section Mutable Sequence Types).
以后记得多看参考文档,里面有很详细的解释!!
举报
学习函数式、模块和面向对象编程,掌握Python高级程序设计
购课补贴联系客服咨询优惠详情
慕课网APP您的移动学习伙伴
扫描二维码关注慕课网微信公众号