Arbitrary Argument Lists : Function Tuple Parameters « Function « Python






Arbitrary Argument Lists


#A function can be called with an arbitrary number of arguments. 
#These arguments will be wrapped up in a tuple. Before the variable number 
#of arguments, zero or more normal arguments may occur.

def fprintf(file, format, *args):
    file.write(format % args)



           
       








Related examples in the same category

1.Any number of parameter: turn parameter into a tupleAny number of parameter: turn parameter into a tuple
2.Unpacking Argument ListsUnpacking Argument Lists
3.Parameter passing: mixed with dictionary and tupleParameter passing: mixed with dictionary and tuple
4.Illustrate parameter passing: tuple, type and tupleIllustrate parameter passing: tuple, type and tuple
5.Re design the intersect and union using tuple parameter passing