[Tutor] How to make the loop work?

Ivan Low visional_freeman at yahoo.com
Thu Jun 22 14:57:45 CEST 2006


Hi, I'm new to python trying to figure how to make this work.

c=0;d=raw_input("input number limit: ")

while 1:
    c = c + 1
    if c == d: break
    print c,


My idea is to able to input a number to limit the print out of this loop.
But this will not work. Where is the error?

Ivan


More information about the Tutor mailing list