摘要: #encoding=utf-8#http://python.jobbole.com/85231/#作用域a=1def A(a): a=2 print 'A:',a def B(): print 'B:',aA(a)print '外部:',aB()#函数内的赋值无法改变函数外的值'''A: 2外部: 阅读全文
posted @ 2018-08-24 15:34 GarVicker 阅读(163) 评论(0) 推荐(0)
摘要: 首先来看私有函数 #encoding=utf-8class A(object): def __init__(self): self.__private() self.public() def __private(self): print 'A.__private()' def public(self 阅读全文
posted @ 2018-08-24 11:13 GarVicker 阅读(225) 评论(0) 推荐(0)