for i, item in enumerate(array): do_something_with(item, i)