Created
July 15, 2018 20:35
-
-
Save solen003/71e43a92083def35388828830597e898 to your computer and use it in GitHub Desktop.
Write a program that accepts a comma separated sequence of words as input and prints the words in a comma-separated sequence after sorting them alphabetically. Suppose the following input is supplied to the program: without,hello,bag,world Then, the output should be: bag,hello,without,world
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
phrase = input("Input words: ") | |
phrase_list = phrase.split(",") | |
phrase_list.sort() | |
print((', ').join(phrase_list)) |
Wrong code , at least run once before posting.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Write a program that accepts a comma - separated sequence of
words as input and prints the words in a comma - separated
sequence after sorting them alphabetically .
Sample Input
order , hello , would , test
Sample Output
hello , order , test , would
// I want this problem answer please send anyone