You can use range(len(some_list)) and then lookup the index like this
xs = [8, 23, 45]
for i in range(len(xs)):
print("item #{} = {}".format(i + 1, xs[i]))
Or use the Python’s built-in enumerateenumerate function which allows you to loop over a list and retrieve the index and the value of each item in the list
xs = [8, 23, 45]
for idx, val in enumerate(xs, start=1):
print("item #{} = {}".format(idx, val))