python-4th step for python

change two parament:
a = a+b
b = a-b
a = a-b
or:
a,b = (b,a)

default parament:
def a(b,m="",c=false):
    d = "e"
    if not c :
        d = "f"
a(g,c = true)

more parament :
more than one parament needed for one function,before we use the function:
*a #for tuple
**b#for dictionary
def c (d,*args, **kwargs) :
c(1,2,3,4,5, qq = 123456, mail = "123456")
include:
d = 1
args = (2,3,4,5)
kwargs = {'qq' :"123456", 'mail ':"1234356"}

你可能感兴趣的:(python)