When you change count = count + 1
to count = count + 3
or count = count + 9
, count
will never be equal to 100. At the very best it'll be 99. That's not enough.
What you've got here is the classic case of infinite loop: count
is never equal to 100 (sure, at some point it'll be greater than 100, but your while
loop doesn't check for this condition) and the while
loop goes on and on.
What you want is probably:
while count < 100: # Or <=, if you feel like printing a hundred.
Not:
while count != 0: # Spaces around !=. Makes Guido van Rossum happy.
Now the loop will terminate when count >= 100
.
Take a look at Python documentation.