Original address: Http://docs.pythontab.com/python/python3.4/controlflow.html#tut-functions
One of the least common choices is to have the function call a variable number of arguments. These parameters are packed into a tuple (see tuples and sequences ). Before these variable number of parameters, there can be 0 to more common parameters.
def write_multiple_items (file, separator, *args): file.write (Separator.join (args))
Typically, these mutable parameters are in the parameter list because they pass all the remaining input parameters to the function. last one
Any arguments that appear after *args are keyword parameters, which means that they can only be used as keywords, not positional parameters.
def Contact (*args,sep='/'): return sep.join (args)
Call Function:
Contact ("wo","shi","wo" )
Output Result:
Wo/shi/wo
Python variable parameters