I have this 2 list
a = [3,9,1,4,5]
b = [7,2,1,0,1]
Im trying to print a line based on some condition (same value or same index and value in 2 list), and the output should be
"Same Value(for duplicate number)"
"Same Value + Index(for duplicate number and same index)"
I tried using iteration and if like this
for x in a:
for y in b:
if x == y:
if (a.index(x) == b.index(y)):
print("Same Value + Index")
else:
print("Same Value")
but somehow the output shows this :
Same Value + Index
Same Value + Index
[Finished in 0.4s]
Or maybe is there any easier way for this? Thank you!