Scoping.py源代码分析
来源:互联网 发布:java程序员壁纸 编辑:程序博客网 时间:2024/05/19 18:41
x = 1 # global variable#全局变量# alters the local variable x, shadows the global variabledef a(): x = 25 #局部变量 print "/nlocal x in a is", x, "after entering a" #打印局部变量 x += 1 print "local x in a is", x, "before exiting a" #打印变化后的局部变量# alters the global variable xdef b(): global x #声明使用全局变量x print "/nglobal x is", x, "on entering b" 打印全局变量 x *= 10 #修改全局变量 print "global x is", x, "on exiting b" #打印修改后的全局变量print "global x is", x#再次打印全局变量x = 7print "global x is", x#运行时,首次修改全局x,并打印a()b()a()b()print "/nglobal x is", x
- Scoping.py源代码分析
- fibonacci.py源代码分析
- builddialectexamples.py源代码分析
- plural.py源代码分析
- regression.py源代码分析
- apihelpertest.py源代码分析
- argecho.py源代码分析
- soundex.py源代码分析
- plural1.py源代码分析
- toolbox.py源代码分析
- sum.py源代码分析
- stringFormatting.py源代码分析
- operator.py源代码分析
- average.py源代码分析
- square.py源代码分析
- classAverage.py源代码分析
- examResult.py源代码分析
- while.py源代码分析
- 读《开发团队中的文档编写者》
- GDI中的坐标映射问题
- ReaderWriterLock要点
- Windows编程中的映射模式和坐标转换
- 欢迎使用CSDN论坛阅读器 : CSDN Reader(附全部源代码) 最新版本:20090608
- Scoping.py源代码分析
- BoundsChecker 内存泄露 检测 简易使用教程
- 非多态情况 (动态)
- 淘宝 TOP 平台Open API入门篇
- 读《拒绝形式化的软件工程文档》
- 色环电阻和电感区别
- ReaderWriterLock要点
- 输入框函数POPUP_GET_VALUES
- UML用例图,类图,顺序图