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
 
   

 






 

你可能感兴趣的:(python)