Skip to content

Instantly share code, notes, and snippets.

@AliBahaari
Last active November 7, 2021 11:15
Show Gist options
  • Select an option

  • Save AliBahaari/e5929a4ec7b4d37eb38f670b2a1b2dda to your computer and use it in GitHub Desktop.

Select an option

Save AliBahaari/e5929a4ec7b4d37eb38f670b2a1b2dda to your computer and use it in GitHub Desktop.
How to remove duplicates from a list?
duplicatesList = [1, 2, 3, 4, 5, 5, 4, 3, 2, 1]
cleanedList = list(set(duplicatesList))
print(cleanedList)
# Output: [1, 2, 3, 4, 5]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment