On 11/03/14 13:53, Yanni Phone wrote:

health = 10
trolls = 0
damage = 3
while health != 0:
    trolls += 1
    health -= damage

This seems simple enough. (This is an example of a non-terminating loop,
by the way, so it is not suppose to work correctly.)

My problem is that when I enter this into IDLE, and hot enter a few times.
> I never get my prompt (>>>) back.

That's because, as you just said, its a non-terminating loop.
The prompt only returns when the loop ends, which is currently never.

You will need to interrupt the loop (using Ctrl-C?) and fix the bug.



--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to