主页
Python
Python sorted() 函数
demo_ref_sorted4
运行 ❯
×
更改方向
保存代码
更改主题
a = ("h", "b", "a", "c", "f", "d", "e", "g") x = sorted(a, reverse=True) print(x)
['h', 'g', 'f', 'e', 'd', 'c', 'b', 'a']