立即学习:https://edu.csdn.net/course/play/26755/340127?utm_source=blogtoedu
14.列表的排序方法
.sort()
增序排列
sorted(a)
区别:.sort()会改变原来列表,sorted()不会只返回
Sort()属于列表,sorted()是一个函数
15.倒序排列
.sort(reverse = True)
Sorted(a, reverse = True)
立即学习:https://edu.csdn.net/course/play/26755/340127?utm_source=blogtoedu
14.列表的排序方法
.sort()
增序排列
sorted(a)
区别:.sort()会改变原来列表,sorted()不会只返回
Sort()属于列表,sorted()是一个函数
15.倒序排列
.sort(reverse = True)
Sorted(a, reverse = True)