Below is my code which is finding a common element.
but I actually want to get the index of it as well, can someone tell me how to do that?
a1=[11,10,21,23,24,25,128,12]
b1=[1,2,11,12,21]
c=[]
index_a1=[]
index_b1=[]
for element in a1:
if element in b1:
c.append(element)
c
i want index_b1(expected result)
like [2,3,4]
, and index_a1
as well if possible.
thanks