在上一讲代码的基础上,做进一步修改,成为了如下程序,请看官研习这个程序:
复制代码 代码如下:
class Person:
def init(self, name, email):
self.name = name
self.email = email
class Programmer(Person):
def init(self, name,email,lang, system, website):
Person.init(self,name,email)
self.lang = lang
self.system = system
self.website = website
class Pythoner(Programmer):
def init(self,name,email):
Programmer.init(self,name,email,"python","Ubuntu","qiwsir.github.io")
if name=="main":
writer = Pythoner("qiwsir","qiwsir@gmail.com")
print "name=",writer.name
print "lang=",writer.lang
print "email=",writer.email
print "system=",writer.system
print "website=",writer.website
name= qiwsir
lang= python
email= qiwsir@gmail.com
system= Ubuntu
website= qiwsir.github.io
Copyright© 2013-2020
All Rights Reserved 京ICP备2023019179号-8