Commit fc9a4ace by BellCodeEditor

auto save

parent a721ce8f
Showing with 6 additions and 6 deletions
...@@ -4,7 +4,7 @@ class Dog: # 狗类 ...@@ -4,7 +4,7 @@ class Dog: # 狗类
self.eyeNum = 2 # 眼睛 self.eyeNum = 2 # 眼睛
self.head = 1 # 头 self.head = 1 # 头
self.earsNum = 2 # 耳朵 self.earsNum = 2 # 耳朵
self.skin = "white" self.skin = ""
def run(self): def run(self):
print("狗狗飞快的跑起来") print("狗狗飞快的跑起来")
...@@ -13,8 +13,8 @@ class Dog: # 狗类 ...@@ -13,8 +13,8 @@ class Dog: # 狗类
class Husky(Dog): # 哈士奇类 class Husky(Dog): # 哈士奇类
def __init__(self): def __init__(self):
super().__init__() super().__init__()
self.skin = "black" self.skin = "黑"
print("小狗coco创建成功,它是"+coco.size+"的")
print("coco是"+coco.skin+"色的,它有"+str(coco.footNum)+"条腿,"+str(coco.eyeNum)+"个眼睛"+str(coco.head)+"个头,"+str(coco.earsNum)+"个耳朵,它的体型很"+coco.size)
print(coco.run())
coco = Husky() coco = Husky()
\ No newline at end of file
print("coco是"+coco.skin+"色的,它有"+str(coco.footNum)+"条腿,"+str(coco.eyeNum)+"个眼睛"+str(coco.head)+"个头,"+str(coco.earsNum)+"个耳朵")
print(coco.run())
\ No newline at end of file
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