Skip to content

Instantly share code, notes, and snippets.

@balazs-endresz
Created September 25, 2015 12:25
Show Gist options
  • Save balazs-endresz/89da01dc23c1e7ad89ea to your computer and use it in GitHub Desktop.
Save balazs-endresz/89da01dc23c1e7ad89ea to your computer and use it in GitHub Desktop.
Remove duplicates from a list while preserving original ordering
sorted(set(sorted_list), key=lambda x: sorted_list.index(x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment