Created
September 4, 2016 18:04
-
-
Save ooade/a656a02bd195f25b12ee73cdbb241e6a to your computer and use it in GitHub Desktop.
Remove duplicates in a list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def remove_duplicates(nums): | |
| no_dup = [] | |
| for num in nums: | |
| if not(num in no_dup): | |
| no_dup.append(num) | |
| return no_dup | |
| print remove_duplicates([1,1,2,2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment