Python Dynamic Loop

z = 0
range = 10
while z < range:
    print(z)
    if z == 9:
        range = 20
    z += 1
Enn