Is it possible to find the index of a list in a for loop without using a generator?
for character in string:
if character == "a":
print(get_index_somehow)
I am aware that you could use a generator in a for loop and get the index that way
for i in range(len(string)):
character = string[i]
if character == "a":
print(i)
Just curious if it's possible