Commit 96ca2af0 by BellCodeEditor

save project

parent 203cbccf
Showing with 22 additions and 2 deletions
class Dog:
def __init__(self):
self.footNum = 4
self.eyeNum = 2
self.head = 1
self.skin = "white"
def run(self):
print("狗狗飞快的跑起来")
class Husky(Dog):
def __init__(self):
super().__init__(skin)
self.skin = "black"
coco=Husky()
print(coco.skin)
\ No newline at end of file
......@@ -24,12 +24,14 @@ class Hero: # 英雄类
class Player(Hero):
def __init__(self,name):
self.level = 1
super().__init__(name)
self.name = name
self.hp = 200
self.attack = 50
player = Player("后羿")
print("玩家的血量值为:",player.hp)
print("玩家的攻击力为:",player.attack)
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