Change a loop variable in the loop

Will the change affect loop control?

Python:

for i in range(10):
    print(i)
    i = 2 * i   # change loop variable
print("After a 'for' loop, i =", i, end=".\n")

Output

0
1
2
3
4
5
6
7
8
9
After a 'for' loop, i = 18.

JAVA:

Output

0
1
3
7
END of i= 15.

Python:

The number of times to iterate will not be changed.

JAVA:

Loop variable is changed and number of iterations is changed, too.