Commit f5b9231d by BellCodeEditor

save project

parent d51b020e
Showing with 7 additions and 8 deletions
...@@ -4,11 +4,11 @@ class Hero: ...@@ -4,11 +4,11 @@ class Hero:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
self.name=name self.name=name
def upgrade(self):
self.level=self.level+1
self.hp=self.hp+1
self.attack=self.attack+1
yase=Hero("牙色",300,20) yase=Hero("牙色",300,20)
print(yase.level) yase.upgrade()
def upgrade(): print(yase)
yase.level=yase.level+1
yase.hp=yase.hp+1
yase.attack=yase.attack+1
print(upgrade())
\ 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