I have 3 lists and I want to find the difference between the 1st/2nd and 2nd/3rd and print them.
Here is my code:
n1 = [1,1,1,2,3]
n2 = [1,1,1,2] # Here the 3 is not found ("3" is not present in n1 at all)
n3 = [1,1,2] # here 1 is not found (there are fewer "1"s in n3 than in n2)
for x in n1:
if x not in n2:
print x
for m in n2:
if m not in n3:
print m
but i get only 3 as output.
How to make it output 1 and 3? I tried using set
s as well, but it only printed 3
again.