首页 > 代码库 > python 形参

python 形参

def fun(x="dx",y="dy"):
print "fun------"
print x
print y

fun()
fun("aa","bb")
fun(x="ha",y="la")

ct = dict(x="haha",y="lala")
fun(**ct)

==================================
fun------
dx
dy
fun------
aa
bb
fun------
ha
la
fun------
haha
lala
=============================

python 形参