lists = [8,2,4,1,5,7,3] # 对lists进行排序,但不改变lists print(sorted(lists)) # 对lists进行排序,且改变了lists lists.sort() print(lists)
python -- sorted() 函数与 .sort() 的区别
猜你喜欢
转载自blog.csdn.net/weixin_41355124/article/details/80187837
今日推荐
周排行