[Tutor] Loop Issue

Yanni Phone yannisphone at gmail.com
Thu Mar 13 16:22:56 CET 2014


OK, thank you. I knew the loop was infinite but usuyally when I did
infinite loops before, I had them print out a message, so it was obvious.
Thanks for the clarification.


On Thu, Mar 13, 2014 at 9:38 AM, spir <denis.spir at gmail.com> wrote:

> On 03/13/2014 12:40 AM, Danny Yoo wrote:
>
>> The context is the beginning of the thread:
>>
>>      https://mail.python.org/pipermail/tutor/2014-March/100543.html
>>
>> with the loop:
>>
>>
>> ###
>> while health != 0:
>>      ...
>> ###
>>
>
> The point, and reason why this loop was (potentially) infinite, is that
> the condition was false. Should be <0 instead ('cause health points are not
> removed one by one, so that a health value of 0 exactly can be jumped over).
>
> d
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140313/1952e334/attachment.html>


More information about the Tutor mailing list