Commit 2f1ddbc5 by BellCodeEditor

save project

parent 1edf2cd0
Showing with 11 additions and 1 deletions
......@@ -12,5 +12,14 @@ class Hero:
info3 = enemy.name+"还剩下"+str(enemy.hp)+"血量"
info = info1=info2+info3
print(info)
exit()
class Player(Hero):
def __init__(self,name):
self().__init__(name)
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