# L-10 MCS 260 Wed 3 Feb 2010 : sortwords # # This program shows intrinsic operations # on strings and lists, to sort words, # given as a raw input string by the user. # s = raw_input('Give words : '); L = s.split() # spaces separate the words L.sort() # sort the list alphabetically s = ' '.join(L) # join the sorted list print 'Sorted words :' , s