0
i wanna tackle a real world problem...its described below.....
i wanna make the user input a list of guests....then these names would be entered in a list ....the list would be sorted and then given back to the user....how can i code a program which could do these things ...plz send me the solution using python..... morever i want more such real world problems to solve.....where could i get them with solution....
7 Antworten
0
sorted how?
0
alphabetically
0
if you enter all the guests using their first name only eg.ben and not ben smith then you could do ( it also has to all be on the same line)
list = sorted(input().split())
and then just print it
0
sorry...i didnt get it....plz type in the entire solution...
0
list = sorted(input().split())
print (*list)
input: ben terry john
output: ben john terry
0
thats not working...
https://code.sololearn.com/c68b1i7sUHv9/?ref=app
0
oh...i m very sorry....its working properly...thanks a lot