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
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
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
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
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