Created
December 10, 2021 07:02
-
-
Save pralabhsaxena05/e42c5035ed556138d7f83e89b7865920 to your computer and use it in GitHub Desktop.
This file contains 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
mylist = [1,2,3,3,4,'John', 'Ana', 'Mark', 'John'] | |
#Method 1 | |
def remove_duplicate(list_value): | |
return list(set(list_value)) | |
print(remove_duplicate(mylist)) | |
#Method 2 | |
result = [] | |
[result.append(x) for x in mylist if x not in result] | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment