默认为升序,降序要用参数 reverse = True
>>> lst = [2,5,7,1,6] >>> sorted(lst, reverse = True) [7, 6, 5, 2, 1] >>> sorted(lst) [1, 2, 5, 6, 7]