Q:

Write a Python program that accepts a comma separated sequence of words as input and prints the unique words in sorted form (alphanumerically).

0

Write a Python program that accepts a comma separated sequence of words as input and prints the unique words in sorted form (alphanumerically).

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now