I am trying to loop through a list. But it is getting the first element. It doesn't gets the second element. I can't figure out what i am doing wrong.
filte = ['fingerprint','cipher']
dupe = ['cipher','extract']
for val in filte:
print(val)
if val in dupe:
dupe.remove(val)
else:
filte.remove(val)
print("filter",filte)
print("dupe",dupe)
output i got:
fingerprint
filter ['cipher']
dupe ['cipher', 'extract']
required output:
fingerprint
cipher
filter ['cipher']
dupe [ 'extract']
cipherbecomes the first one, so there is no second.