python
Published on January 26, 2024By DeveloperBreeze
# Define a list with duplicates
my_list = [10, 20, 30, 20, 40, 10, 50]
# Create a new list with unique elements using set
unique_list = list(set(my_list))
# Define a list with duplicates
my_list = [10, 20, 30, 20, 40, 10, 50]
# Create a new list with unique elements using set
unique_list = list(set(my_list))
Comments
Please log in to leave a comment.