remove-duplicate-elements-in-a-list-with-python

Remove duplicate elements in a list with Python

A simple and efficient way to remove duplicate elements from a list using Python.

Python Code

numbers = [1,1,2,3,3,4]
print(numbers)
s = set(numbers)

print(s)
#Output: [1, 2, 3, 4]

unique_numbers = list(s)

print(unique_numbers)
#Output: [1, 2, 3, 4]

Related Posts

reverse-string
How to reverse a string

A simple way of reversing a string in different languages.

Use Emoji's in Python
Use Emoji’s in Python

Did you know you can use Emoji's in Python? Learn how to!