friends = ['a', 'd', 'b', 'c']
friends.sort()
print(friends)

prints,

$ C:/python/Python311/python.exe "c:/Users/LENOVO/OneDrive/Desktop/python/python folder/hello.py" ['a', 'b', 'c', 'd']

friends = ['Shafni', 'Glenn', 'Joseph']
friends.sort()
print(friends)

$ C:/python/Python311/python.exe "c:/Users/LENOVO/OneDrive/Desktop/python/python folder/hello.py" ['Glenn', 'Joseph', 'Shafni']