Commit 79f26faf by BellCodeEditor

save project

parent f7187db3
Showing with 10 additions and 2 deletions
......@@ -3,7 +3,15 @@ class Hero:
self.level=1
self.hp=300
self.attack=20
def upgrade(self):
self.level=self.level+1
self.hp=self.hp+100
self.attack=self.attack+4
yase=Hero("亚瑟",300,523)
houyi=Hero("后羿",240,645)
print(yase.level)
\ No newline at end of file
print(yase.level)
houyi.upgrade()
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