Skip to content

Instantly share code, notes, and snippets.

@pralabhsaxena05
Created December 10, 2021 07:02
Show Gist options
  • Save pralabhsaxena05/e42c5035ed556138d7f83e89b7865920 to your computer and use it in GitHub Desktop.
Save pralabhsaxena05/e42c5035ed556138d7f83e89b7865920 to your computer and use it in GitHub Desktop.
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