so im given two lists
lst1 =[0,1,1,1,0]
lst2 =[0,0,1,1,0]
and i need to see which index in both lists have the value 1 here is my code so far
x = list(zip(lst1,lst2))
for i in range(len(x)):
flag = 0
for y in range(len(x[i])):
if x[i][y] == 1:
flag +=1
if flag == 2:
z = x.index(x[i])
print(z)
but this prints the index 2 and 2 instead of 2 and 3 can anyone point out the problem here, thanks