[Tutor] How to make the loop work?

2006-06-22 Thread Ivan Low
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

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

[Tutor] What is the square bracket about?

2006-07-22 Thread Ivan Low
def adder1(*args): print 'adder1', if type(args[0]) == type(0): sum = 0 else: sum = args[0][:0] for arg in args: sum = sum + arg return sum Hi, I was trying to understand what this function is all about. I didn't tried the adder1 function which