programming-examples/python/List/Python program to get unique values from a list.py
2019-11-15 12:59:38 +01:00

5 lines
185 B
Python

my_list = [10, 20, 30, 40, 20, 50, 60, 40]
print("Original List : ",my_list)
my_set = set(my_list)
my_new_list = list(my_set)
print("List of unique numbers : ",my_new_list)