Commit d61fc25e by BellCodeEditor

auto save

parent 4dbc2f61
Showing with 12 additions and 5 deletions
...@@ -17,7 +17,14 @@ class Hero(object): ...@@ -17,7 +17,14 @@ class Hero(object):
else: else:
info3=enemy.name+"阵亡,游戏结束" info3=enemy.name+"阵亡,游戏结束"
info=info1+info2+info3 info=info1+info2+info3
rint(info) print(info)
yase = Hero("垭瑟") exit()
houyi= Hero("后羿") class player(hero):
yase.combat(houyi) def __init__(self,name):
\ No newline at end of file super.__init__()
self.hp=200
self.attack=50
player=player("后羿")
print("玩家血量为:",player.hp)
print("玩家攻击力为:",player.attack)
\ 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