How to sort a list of strings?

后端 未结 11 945
孤独总比滥情好
孤独总比滥情好 2020-11-22 11:22

What is the best way of creating an alphabetically sorted list in Python?

11条回答
  •  無奈伤痛
    2020-11-22 11:51

    Please use sorted() function in Python3

    items = ["love", "like", "play", "cool", "my"]
    sorted(items2)
    

提交回复
热议问题