为了账号安全,请及时绑定邮箱和手机立即绑定

sorted 函数格式用法请教

为何是:sorted([3,4,1,2,5,4,9,],cmp_ignore_case)形式

而不是:sorted(cmp_ignore_case,[3,4,1,2,5,4,9,])形式

正在回答

1 回答

这个是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).

以后记得多看参考文档,里面有很详细的解释!!

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
python进阶
  • 参与学习       255533    人
  • 解答问题       3038    个

学习函数式、模块和面向对象编程,掌握Python高级程序设计

进入课程

sorted 函数格式用法请教

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号