For a list ["foo", "bar", "baz", "bar"].index('bar') what's the cleanest way to get its index in a loop in Python? Note that .index() returns only the first element which matches in the list
for file_id in file_ids:
file_id_index = file_ids.index(file_id)