L.sort()
Definition : sort(key=None, reverse=False)Type : Function of None moduleL.sort(key=None, reverse=False) -> None -- stable sort IN PLACEsorted()
Definition : sorted(iterable, *, key=None, reverse=False)Type : Function of builtins moduleReturn a NEW sorted list from the items in iterable.*key* specifies a function of one argument that is used to extract a comparison key from each list element: key=str.lower. The default value is None (compare the elements directly).*reverse* is a boolean value. If set to True, then the list elements are sorted as if each comparison were reversed.L.sort()是对L进行就地排序,只适用于列表。sorted()会新建列表,适用于可迭代对象。默认升序排列。
继续阅读与本文标签相同的文章
下一篇 :
大型网站架构演进的五大阶段盘点
-
DotNetNuke各项业务外包
2026-05-25栏目: 教程
-
如何使用IPortable接口?
2026-05-25栏目: 教程
-
“胜兵先胜而后求战,败兵先战而后求胜”—如何通过系统分析师考试
2026-05-25栏目: 教程
-
无尽的爱――开源项目DNN研究心得(转载)
2026-05-25栏目: 教程
-
为什么DNN 4.x 的永久登陆用不了?
2026-05-25栏目: 教程
