Commit fc9dddc2 by BellCodeEditor

save project

parent aba77bc4
Showing with 10 additions and 0 deletions
...@@ -4,7 +4,16 @@ class Hero: ...@@ -4,7 +4,16 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.gj=gj self.gj=gj
def upgrade(self):
self.dj+=1
self.hp+=50
self.gj+=5
houyi=Hero("后羿",1590,257) houyi=Hero("后羿",1590,257)
yase=Hero("亚瑟",3622,164) yase=Hero("亚瑟",3622,164)
houyi.upgrade()
yase.upgrade()
print(yase.hp) print(yase.hp)
print(houyi.hp) print(houyi.hp)
\ 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