[Python] python函数里的局部变量演示代码 →→→→→进入此内容的聊天室

来自 , 2019-09-04, 写在 Python, 查看 107 次.
URL http://www.code666.cn/view/58155fc7
  1. #!/usr/bin/python
  2. # Filename: func_local.py
  3.  
  4. def func(x):
  5.     print 'x is', x
  6.     x = 2
  7.     print 'Changed local x to', x
  8.  
  9. x = 50
  10. func(x)
  11. print 'x is still', x
  12.  
  13.  
  14.  

回复 "python函数里的局部变量演示代码"

这儿你可以回复上面这条便签

captcha