开发者社区 问答 正文

python中sort()和sorted()的区别是什么?

python中sort()和sorted()的区别是什么?

展开
收起
游客qzzytmszf3zhq 2021-11-04 22:47:02 351 分享 版权
1 条回答
写回答
取消 提交回答
  • sort 是应用在 list 上的方法(list.sort()),sorted 可以对所有可迭代的对象进行排序操作

    2021-11-04 22:55:34
    赞同 展开评论