foreach index in a list code example Example: get index in foreach py for idx, val in enumerate(ints): print(idx, val)