Remove duplicates

Report a typo

Suppose you have a list of names. Write a program that takes this list as an input, removes all duplicate names, and returns them in alphabetical order.

To return the names in alphabetical or numerical order, you can use the following built-in methods: list_name.sort() for lists and sorted(variable_name) for sets, tuples or lists. The difference between these two methods is that sort() modifies the original list, and sorted() creates a sorted copy of a collection.

Sample Input 1:

Jane Mary Jane Tom Alex Sam Alex Sam

Sample Output 1:

Alex
Jane
Mary
Sam
Tom
Write a program in Python 3
names = input().split()
___

Create a free account to access the full topic