您的位置:首页 > 编程语言 > Python开发

python 向函数传递多个参数

2013-05-06 14:19 218 查看
m = 5

n = 13

# Add add_function here!

def add_function(*argv):

return sum(argv)#print argv

print add_function(m, n)

############################

m = [1, 2, 3]

n = [4, 5, 6]

o = [7, 8, 9]

# Update the below function to take

# an arbitrary number of arguments

def join_lists(*argv):

listTemp=[]

for item in argv:

listTemp+=item

return listTemp

print join_lists(m, n, o)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: