Answer the question
In order to leave comments, you need to log in
How to correctly remove duplicate elements in lists?
Hello everyone, I have already asked a similar question, but I did not quite correctly describe it. In short:
a = [1,2,1,3]
b = [1,2]
[1,3]
test_2 = [1,2,3,4]
my_paper = [3,1,2 ]
test2 = [int(item) for item in test_2]
for i in test_2:
for j in my_paper:
if i == j:
test2.remove(i)
my_paper.remove(j)
print (test2)
print (my_paper)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question