The easiest way is to use sorted() function that sorts a list of string. The sorted() function modifies your original list to get a sorted copy of the list, without changing the original list below is an example that illustrates the use of shorted() function:-
mylist = ["a", "d", "B"]
for x in sorted(mylist):
print(x)