学习笔记(16):Python 面试100讲(基于Python3.x)-如何排序一个列表

立即学习:https://edu.csdn.net/course/play/26755/340127?utm_source=blogtoedu

如何排序一个列表

1、对列表排序有哪几种方法

a.sort()   sorted(a)

2、两者的区别

改不改变本身的值

3、降序排列

a.sort(reverse = True)

sorted(b,reverse = True)

发布了26 篇原创文章 · 获赞 0 · 访问量 116

猜你喜欢

转载自blog.csdn.net/wuchuang19/article/details/104224916