How to sort a list of strings?

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

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

11条回答
  •  眼角桃花
    2020-11-22 11:54

    Suppose s = "ZWzaAd"

    To sort above string the simple solution will be below one.

    print ''.join(sorted(s))
    

提交回复
热议问题