Python类继承简单实现

代码:

 

 

 

结果:

[work@db-testing-com06-vm3.db01.baidu.com python]$ python inherit.py
init SchoolMember:  yanggang
init Teacher:  yanggang
init SchoolMember:  liming
init Student:  liming

name:yanggang; age:20
salary:  1000
name:liming; age:12
marks:  86

 

posted @ 2010-10-27 17:04  程序员天下  阅读(537)  评论(0编辑  收藏  举报