Created
November 3, 2018 07:17
-
-
Save Ikhiloya/2cfa0da1215960853f14a22c700e70d6 to your computer and use it in GitHub Desktop.
Removing duplicates from 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(numbers): | |
| duplicates = [] | |
| for num in numbers: | |
| if(num not in duplicates): | |
| duplicates.append(num) | |
| return duplicates | |
| remove_duplicates([1, 1, 2, 2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment