#!/usr/bin/python # -*- coding: UTF-8 -*- #可写函数说明 def printinfo(kname, age ): "打印任何传入的字符串" print ("Name: ", kname) print ("Age ", age) return #调用printinfo函数 printinfo(age=50, kname="miki" )
#!/usr/bin/python # -*- coding: UTF-8 -*- #可写函数说明 def printinfo(kname, age ): "打印任何传入的字符串" print ("Name: ", kname) print ("Age ", age) return #调用printinfo函数 printinfo(age=50, kname="miki" ) #!/usr/bin/python # -*- coding: UTF-8 -*- # 可写函数说明 sum = lambda arg1, arg2: arg1 + arg2 # 调用sum函数 print ("相加后的值为 : ", sum( 10, 20 )) print ("相加后的值为 : ", sum( 20, 20 ))
标签:教程,函数,python,age,printinfo,print,kname From: https://www.cnblogs.com/xiongwei/p/18099674