Commit 5299026c by BellCodeEditor

save project

parent 3b2a7d14
Showing with 8 additions and 2 deletions
......@@ -4,8 +4,15 @@ class Hero:
self.hp=hp
self.Lv=1
self.attack=attack
def upgrade(self):
self.Lv=self.Lv+1
self.hp=self.hp+50
self.attack=self.attack+4
yase=Hero("亚瑟",300,20)
print(yase.hp)
hoyi=Hero('后羿',250,23)
print(hoyi.attack)
\ No newline at end of file
print(hoyi.attack)
yase.upgrade()
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