[Tutor] (no subject)

Felix Santiago felixsan at gmail.com
Sat Sep 5 03:49:10 CEST 2009


On Sep 4, 2009, at 8:31 PM, kb1pkl at aim.com wrote:

> I know, I'm a total noob (started yester day)
> But when I enter this code:
> x = 1
> if x>0:
>     a = raw_input ("Type something in...I will echo it:")
>     print a
>     x=x+1
> it does not loop..am I missing something here?

In your example the if statement is only evaluated once, for when x =  
1.  If you want to create a loop replace the if with a while.

--Felix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090904/131e1bd8/attachment.htm>


More information about the Tutor mailing list