###### python的参数

def out(massege,times=1):
print massege*times
out('hello ')
out('hello ',5)

>>>
hello
hello hello hello hello hello
>>> 

def out(a,b,c):
print 'a is ',a,' b is ',b,' c is ',c
out(1,2,3)
out(a=2,b=3,c=1)
out(1,c=2,b=3)
>>>
a is  1  b is  2  c is  3
a is  2  b is  3  c is  1
a is  1  b is  3  c is  2
>>> 

print 'local test:'
x=23
def func1(x):
print x
x=x+1
print x
func1(x)
print x

print 'global test:'
x=23
def func2():
global x
print x
x=x+1
print x
func2()
print x

>>>
local test:
23
24
23
global test:
23
24
24
>>>


def func(intial=0,*a,**m):
sum=intial
for i in a:
sum=sum+i
for k in m:
sum=sum+m[k]
return sum

>>>
38
>>> 

def func1(a=0,*b,c):
sum=a
for i in b:
sum=sum+i
print sum+c
func1(1,2,3,100)

#### python学习笔记3-函数

2017-05-11 23:06:13

#### Python学习之函数

2015-08-02 20:46:44

#### 4 线程 ［2］

2010-08-07 23:15:00

#### Python基础笔记

2013-02-16 13:28:55

#### Lodop打印参数方法参考

2017-04-17 10:21:48

#### bindParam()方法绑定参数

2016-10-11 19:52:15

#### Python给函数传递不定个数的参数

2016-08-19 13:42:47

#### shell函数功能

2014-11-01 12:04:11

#### Lodop打印控件HTML转成jpg等文件，图片上传服务器

2015-02-04 16:21:15

#### python星号参数

2018年03月30日 156KB 下载

python的参数