Commit 92b6bf41 by BellCodeEditor

save project

parent f80a4b16
Showing with 7 additions and 7 deletions
...@@ -4,13 +4,13 @@ class hero: ...@@ -4,13 +4,13 @@ class hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=hero("亚瑟",300,2000000000000000000000)
print(yase.attack) def upgrade(self):
def upgrade(): self.level=self.level+1
yase.level=level+1 self.attack=self.attack+4
yase.attack=attack+4 self.hp=self.hp+50
yase.hp=hp+50
upgrade() upgrade()
upgrade() upgrade()
print() yase=hero("亚瑟",300,2000000000000000000000)
print(yase.attack)
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