Answers for "remove double elements list python"

1

python remove duplicates

word = input().split()

for i in word:
  if word.count(i) > 1:
    word.remove(i)
Posted by: Guest on February-04-2020
0

python remove all double elements from list

new_list = list(set(my_list))
Posted by: Guest on October-02-2021
0

python remove all double elements from list

seen = {}
new_list = [seen.setdefault(x, x) for x in my_list if x not in seen]
Posted by: Guest on October-02-2021

Code answers related to "remove double elements list python"

Python Answers by Framework

Browse Popular Code Answers by Language