Python noob; please explain why this loop doesn\'t exit.
for i in range(0,10): print \"Hello, World!\" if i == 5: i = 15 print i next
Because what you have done with range(0,10) is created an array of 10 elements like so:
range(0,10)
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
and you are going through each one.
In other programming languages, you are doing what is called a foreach loop.
Otherwise, do it another way.