1#!/usr/bin/env python3
2
3# Question 8
4# Level 2
5
6# Question:
7# Write a program that accepts a comma separated sequence of words as input and prints the words
8# in a comma-separated sequence after sorting them alphabetically.
9# Suppose the following input is supplied to the program:
10# without,hello,bag,world
11# Then, the output should be:
12# bag,hello,without,world
13
14# Hints:
15# In case of input data being supplied to the question, it should be assumed to be a console input.
16
17
18def sort_words():
19 words_raw = input('Please enter a comma separated list of words\n')
20 words_list = words_raw.split(',')
21 print(sorted(words_list))
22
23
24if __name__ == '__main__':
25 sort_words()