functions with unlimeted variable arguments...

Xah Lee xah at xahlee.org
Sat Jun 18 03:19:11 EDT 2005


how can i define a function with variable parameters? For example,

f(a) would return [a]
f(a,b) would return [a,b]
f(a,b,...) would return [a,b,...]

One solution is of course to make the argument as a list. i.e.
f([a,b,...])
but are there other solutions?

 Xah
 xah at xahlee.orghttp://xahlee.org/




More information about the Python-list mailing list