Re: [Tutor] variable number of inputs

2009-01-08 Thread Alan Gauld
"wesley chun" wrote a very popular idiom you'll see in function signatures looks like this: def func(*args, **kwargs) this is the most flexible Python function definition because this function can accept *any* number and type of arguments you can give But the caveat: With power comes resp

Re: [Tutor] variable number of inputs

2009-01-07 Thread wesley chun
On Wed, Jan 7, 2009 at 7:01 PM, bob gailer wrote: > Mr Gerard Kelly wrote: >> >> How can you make a function accept a variable number of inputs without >> any particular limit? >>: >> But what if you want to be able to call the function and put in as many >> arguments as you want. > > def

Re: [Tutor] variable number of inputs

2009-01-07 Thread bob gailer
Mr Gerard Kelly wrote: How can you make a function accept a variable number of inputs without any particular limit? Like when you define a function you usually go: def func(a,b,c,d,e) and if you want to give a default value for e you can use e=0 for example. But what if you want to be able to

[Tutor] variable number of inputs

2009-01-07 Thread Mr Gerard Kelly
How can you make a function accept a variable number of inputs without any particular limit? Like when you define a function you usually go: def func(a,b,c,d,e) and if you want to give a default value for e you can use e=0 for example. But what if you want to be able to call the function and pu