Using indefinite arguments
Representation: *(argument name)
Example: Create a function, myFun, that takes an arbitrary number of lists and concatenates them.
m = [1,2,3]
n = [4,5,6]
o = [7,8,9]
def myFun(*args):
result = []
for item in range(len(args)):
result += args[item]
return result
print myFun(m,n,o)
评论