摘要:
匿名函数 -基本语法结构: lambda x : x+1 x:形参 x+1 返回值 例如:以下函数相当于lambda x : x+1 def calc (x): return x +1 res = calc(10) print(res) 将函数用匿名函数表示 def change_name(): r 阅读全文
摘要:
作用域 注意:函数,模块,类都有自己的作用域 for循环,while循环,if,else 都没有自己的作用域 def test1(): print("in the test1")def test(): print("in the test") return test1 》test1 是函数test1 阅读全文