Any number of parameter: turn parameter into a tuple : Function Tuple Parameters « Function « Python






Any number of parameter: turn parameter into a tuple

Any number of parameter: turn parameter into a tuple

def f(*args): print args

f()

f(1)

f(1,2,3,4)

           
       








Related examples in the same category

1.Unpacking Argument ListsUnpacking Argument Lists
2.Arbitrary 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