In [35]:
def to_index(input_list,a):
index = 0
for item in input_list:
index = index + 1
if item == a:
return index - 1
In [36]:
b = [1,2,3,4,5,6]
In [37]:
to_index(b,5)
Out[37]:
In [ ]: