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
2019-11-18 14:44:36 +01:00

3 lines
150 B
Python

items = input("Input comma separated sequence of words")
words = [word for word in items.split(",")]
print(",".join(sorted(list(set(words)))))