标签:python global print oba lse div 输出 bsp pre
代码如下:
s=1 def sum(): s=100 print(s) sum() print(s)
输出:100
1
代码变为:
s=1 def sum(): global s s=200 print(s) sum() print(s)
输出:200
200
标签:python global print oba lse div 输出 bsp pre
原文地址:https://www.cnblogs.com/blogzyq/p/11308111.html