I want to make a program where I ask the user names and he keeps them and orders them alphabetically.
This is what I have now:
names = input("What are the names? ")
print(names)
sorted_names = sorted(names)
print(sorted_names)
but when I run the program, this comes out
[' ', ' ', ' ', 'M', 'M', 'Z', 'a', 'a', 'c', 'c', 'i', 'l', 'o', 'o', 'p', 'r', 't', 't']
Sort each letter alphabetically.
How to make the names come out complete and ordered alphabetically?