January 19, 2016 Pyhton中变量的作用域¶ 下面的程序: def test(): if a == 100: b = 10 print(b) if __name__ == '__main__': a = 100 b = 11 test() print(b) # 程序输出结果为 # 10 # 11 Posted by LiuHui Filed under: python, program Tags: python, program, learn « Learning Python RPM软件包 » Please enable JavaScript to view the comments powered by Disqus.