企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## 坐标移动 ```python def startPostion(a=0, b=0): postion = [a, b] def move(x=1, y=1): postion[0] += x postion[1] += y return postion return move ``` ```python action = startPos(0,0) action(1,2) [1, 2] action() [2, 3] ``` ## 计数器 ~~~python def counter(a=0): current = [a] def add_one(x=1): current[0] += x return current[0] return add_one c = counter() print(c()) print(c(2)) ~~~