I want to input 5 names and then sort them manually.
Is there any shorter solution than this??
def swap(x,y):
L[x],L[y]=L[y],L[x]
L = input("Enter names separated by space: ")
L = L.split(" ")
for x in range(len(L)):
for y in range(len(L)-1):
if L[y] > L[y+1]:
swap(y,y+1)
print(L)