Commit d3d077aa by BellCodeEditor

save project

parent dc9152b9
Showing with 73 additions and 5 deletions
......@@ -19,10 +19,79 @@ class Hero(object):
a4=a1+"-"*126+a2+"-"*126+a3
print(a4)
class Player(Hero):
def __init__(self,name):
def __init__(self,name,hero__type):
super().__init__(name)
self.hp = 300
self.attack = 15
yase = Hero("垭瑟")
houyi= Hero("后羿")
yase.combat(houyi)
\ No newline at end of file
self.hero__type=hero__type
print("角色"+self.name+"创建成功,英雄类型为:"+self.hero__type)
print("当前等鸡、血量、公鸡力分别为:",self.level,self.hp,self.attack)
caixvkun=Player("蔡徐坤","射手")
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