摘要: 闭包 = 函数 + 环境变量 def factory(): pos = 0 def go(step): nonlocal pos new_pos = pos + step pos = new_pos return pos return go tourist = factory() print(tou 阅读全文
posted @ 2022-03-24 11:19 安静ovo 阅读(25) 评论(0) 推荐(0) 编辑