当前位置: 首页 > 后端技术 > Python

python排序基本函数

时间:2023-03-25 20:12:42 Python

python排序基本函数的几种方法x=[3,4,0,2,1]x.sort()printx#output:01234x.reverse()printx#output:43210y=sorted(x)printy#输出:01234printx#输出:34021