Commit 3c8ccd61 by BellCodeEditor

save project

parent 7041b907
Showing with 6 additions and 2 deletions
......@@ -4,7 +4,11 @@ class Hero:
self.level=15
self.hp=hp
self.attack=100000
def upgrade(self):
self.level=self.level+1
self.hp=self.hp+50
self.attack=self.attack+4
yase=Hero("亚瑟",300,100000)
houyi=Hero("后羿",250,1)
yase.upgrade()
print(yase.hp)
\ No newline at end of file
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