[Tutor] guess age programme (please help)

bodsda at googlemail.com bodsda at googlemail.com
Fri Sep 30 14:17:56 CEST 2011


Hi,

I haven't checked your code because I am on my phone, but here is a tip for the loop condition

Use the guess in your loop condition e.g.

while guesses != 0:
    Do stuff

That way, when guesses does equal 0, the loop condition will be false and therefore the loop will not run.
If you don't want to do that, look into the 'break' statement. 

while someOtherCondition:
    Do stuff
    
    if guesses == 0:
        break



Hope this helps,
Bodsda 



Sent from my BlackBerry® wireless device

-----Original Message-----
From: ADRIAN KELLY <kellyadrian at hotmail.com>
Sender: tutor-bounces+bodsda=googlemail.com at python.org
Date: Fri, 30 Sep 2011 12:04:58 
To: <tutor at python.org>
Subject: [Tutor] guess age programme (please help)

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



More information about the Tutor mailing list