Commit 9bd8fffa by BellCodeEditor

save project

parent 6cf596c0
Showing with 7 additions and 2 deletions
...@@ -4,6 +4,11 @@ class Hero: ...@@ -4,6 +4,11 @@ class Hero:
self.name = name self.name = name
self.hp = hp self.hp = hp
self.attack = attack self.attack = attack
def upgerde def upgerde():
way: self.level=self.level+1
self.hp=self.hp+50
self.attack=self.attack+4
houyi = Hero("后羿",240,23)
houyi.upgerde()
print("亚瑟的血量值为:",yase.hp) print("亚瑟的血量值为:",yase.hp)
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