Commit a847ebc1 by BellCodeEditor

save project

parent 676673b4
Showing with 8 additions and 5 deletions
......@@ -11,12 +11,16 @@ class Dog: # 狗类
class Husky(Dog): # 哈士奇类
def __init__(self):
def __init__(self,name):
self.footNum = 4
self.eyeNum = 2
self.head = 1
self.earsNum = 2
self.earsNum = 2
self.name="谭"
self.skin = "black"
print(self.name+"有"+str(self.footNum)+"条腿")
print(self.name+"有"+str(self.eyeNum))+"个眼睛")
print(self.name+"有"+str(self.head)+"个头")
print(self.name+"有"+str(self.earsNum)+"只耳朵")
coco = Husky()
print(coco.skin)
\ No newline at end of file
coco = Husky("谭")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment