python global 全局变量

http://blog.csdn.net/mldxs/article/details/8559973

__author__ = 'dell'


def func():
    global x
    print 'x is ', x
    x = 2
    print 'Changed local to ', x


x = 50
func()

print 'Value of x is ', x

 






 

posted on 2013-07-23 11:36  雨渐渐  阅读(282)  评论(0编辑  收藏  举报

导航