会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
是阿杰呀
study hungry,study foolish.
首页
新随笔
联系
管理
2021年6月4日
【python】nonlocal关键字
摘要: 【python】nonlocal关键字 ''' nonlocal关键字用来在函数或其他作用域中使用外层(非全局)变量。 ''' def work(): x = 0 def new_work(): nonlocal x x += 3 return x return new_work f=work()
阅读全文
posted @ 2021-06-04 19:45 是阿杰呀
阅读(644)
评论(0)
推荐(0)