Commit 889d6f30 by BellCodeEditor

save project

parent 84ceb4ab
Showing with 11 additions and 2 deletions
...@@ -11,4 +11,13 @@ class Hero(object): ...@@ -11,4 +11,13 @@ class Hero(object):
yase = Hero("垭瑟") yase = Hero("垭瑟")
houyi= Hero("后羿") houyi= Hero("后羿")
yase.combat(houyi) yase.combat(houyi)
houyi.combat(yase) houyi.combat(yase)
\ No newline at end of file
class Player(Hero):
def __init__(self, name):
self.level = 1
self.hp = 200
self.attack = 50
player=Player("后羿")
print("HP为:",player.hp)
print("gongjili为:",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