programming-examples/python/Basics/Python program that accepts a comma separated sequence of words as input and prints the unique words in sorted form (alphanumerically).py

3 lines
150 B
Python
Raw Normal View History

2019-11-18 14:44:36 +01:00
items = input("Input comma separated sequence of words")
words = [word for word in items.split(",")]
print(",".join(sorted(list(set(words)))))