[Tutor] prime test problem

Alan Gauld alan.gauld at btinternet.com
Sat Aug 21 20:14:14 CEST 2010


"Roelof Wobben" <rwobben at hotmail.com> wrote 

> It worked now.
> x=x+1 must have the same indention als the if then and the return.

Or more specifically, it must be indented further than the while 
statement. The fact thatv the other commands inside the while 
loop happen to be an if/else is incidental

x=1
while x < 10:
    x = x+1

works as a loop too.

Alan G.




More information about the Tutor mailing list