Re: [Tutor] How to make the loop work?

2006-06-22 Thread Peter Jessop
It's basically correct but you need to convert the raw_input to integer. c=0 d=int(raw_input(input number limit: )) while 1: c = c + 1 if c == d: break print c ___ Tutor maillist - Tutor@python.org

Re: [Tutor] How to make the loop work?

2006-06-22 Thread Bob Gailer
Ivan Low wrote: 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

Re: [Tutor] How to make the loop work?

2006-06-22 Thread doug shawhan
Hi Bob, You can use a while loop in this case, but range() might be a bit more appropriate! c = 0 d = raw_input(Enter Number Limit: ) for i in range(int(d)): #note, we make sure d is an integer! c = c + 1 print cOn 6/22/06, Bob Gailer [EMAIL PROTECTED] wrote: Ivan Low wrote: Hi, I'm new to

Re: [Tutor] How to make the loop work?

2006-06-22 Thread Ivan Low
Bob Gailer wrote: Ivan Low wrote: 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

Re: [Tutor] How to make the loop work?

2006-06-22 Thread Bob Gailer
Ivan Low wrote: Bob Gailer wrote: Ivan Low wrote: 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