Commit 9071117c by BellCodeEditor

save project

parent af807ec8
Showing with 5 additions and 6 deletions
......@@ -4,13 +4,12 @@ class hero:
self.name=name
self.hp=hp
self.attack=attack
def upgrade(self):
self.hp=self.hp+4
self.level=self.level+1
self.attack=self.attack+50
猴一=hero('猴一',240,10000)
def upgrade():
猴一.hp=猴一.hp+4
猴一.level=猴一.level+1
猴一.attack=猴一.attack+50
猴一.upgrade()
print(猴一.hp)
print(猴一.level)
print(猴一.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