>>> names = ["john", "hack", "blank"]
>>> abc = sorted(names)
>>> abc
['blank', 'hack', 'john']
>>> abcd = sorted(names, reverse=True)
>>> abcd
['john', 'hack', 'blank']

默认是reverse=False 升序

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
  • 2021-07-08
  • 2022-12-23
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
相关资源
相似解决方案