: : (nameage): .name = name .__age = age (say): (% say) (): (% (.name.__age)) .__speek() (): a = A() a.speek() (a.name) (a._A__age) a._A__age += (a._A__age) (A): (nameagesex): A.(nameage) .sex = sex (): (% (.name.sex)) A.speek() b = B() b.speek() : (): () (BC): (nameagesex): B.(nameagesex) (): (): () d = D() d.run(); d.speek(); d.say()
本文出自 “Python” 博客,请务必保留此出处http://guyuejinsheng.blog.51cto.com/9586491/1767634
原文:http://guyuejinsheng.blog.51cto.com/9586491/1767634