摘要:
#函数名可以作为参数,还可以作为变量名,进行赋值,还可以作为函数返回值#列一def add(*foot): num=0 for i in foot: num+=i return (num)def adf(a,b,f): nu=0 nu=f(a)+f(b) print() return nuadf(1 阅读全文
摘要:
作用域由大到小分为:built_in global enclosing localscount=10def add(): print(count)就认为count=10,如果要修改则函数会报错如果一定要这样修改,可以给count一个定义:count=10def add(): global count 阅读全文