Challenge: Sort and Remove Duplicates in the Collection

Test yourself by sorting and removing duplicates from the collection.

Problem statement

Write a program where you do the following:

  1. Define a routine named give_a_word that prompts the user to give a word.

  2. Define a routine named display that sorts the words, removes repeated words, and outputs the contents of the collection.

  3. Ask for 5 words and display the words using the above methods.

Sample input

Get hands-on with 1400+ tech skills courses.