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)
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)
相关文章推荐
- Python的函数参数传递:传值?引用?
- python中函数参数的传递
- Python的函数参数传递:传值?引用?
- Python函数参数传递方式(call by object reference)以及一致性
- Python的函数参数传递:传值?引用?
- Python函数参数传递:传值还是传引用
- python中函数参数传递的几种方法
- Python中函数的参数传递与可变长参数介绍
- Python的函数参数传递:传值?引用?
- python下函数参数的传递(*和**)
- Python的函数参数传递:传值?引用?
- [zt]Python的函数参数传递:传值?引用?
- Python中函数的参数传递方式
- Python的函数参数传递:传值?引用?
- Python的函数参数传递:传值?引用?
- Python中函数的参数传递
- Python中函数的参数传递与可变长参数
- Python中函数参数传递问题
- python go php 函数参数传递总结
- Python def函数的定义、使用及参数传递实现代码