get index with for each python code example Example: get index in foreach py for idx, val in enumerate(ints): print(idx, val)