What is the best way of creating an alphabetically sorted list in Python?
l =['abc' , 'cd' , 'xy' , 'ba' , 'dc'] l.sort() print(l1)
Result
['abc', 'ba', 'cd', 'dc', 'xy']