#函数
def fun(a,b='b'):
print("fun"+a+b)
return a
fun(b='b',a='a')#关键字实参
#传递任意数量实参 实参封装到元组里
def fun1(*arg):
print(arg)
for a in arg:
print(a)
fun1("lol",'lol1')
## 使用关键字实参
def fun2(**userinfo):
print(userinfo)
return userinfo
fun2(name="lol",age=27)
#导入模块
import mode
mode.modeFun()
#导入特定函数
from mode import modeFun,modeFun1
#导入所有函数
from mode import *
#起别名
from mode import modeFun as fun3
fun3()
import mode as m
mode.py
def modeFun():
print("modeFun")
def modeFun1():
print("modeFun1")
标签:函数,Python,mode,modeFun,print,import,实参,def
From: https://www.cnblogs.com/lwx11111/p/16636311.html