• 2025-11-27
python入门:sort函数

Python中sort()方法直接修改列表实现排序,支持reverse参数控制升降序,key参数自定义规则,与sorted()不同在于不返回新列表;注意其无返回值,避免误用导致列表变空。...

11