← Back to the lesson: Sets
Remove Duplicates
The exercise
Given list with duplicates:
numbers = [1, 2, 2, 3, 3, 3, 4]
Convert it to a set to remove duplicates.
Print the length of the set.
Starter code
numbers = [1, 2, 2, 3, 3, 3, 4]
# Convert to set / Преобразуйте во множество
unique =
# Print length / Выведите длину
Write the code in the browser and run it — no installation needed.