Commit b4f0459c by BellCodeEditor

save project

parent dfbc2106
Showing with 7 additions and 7 deletions
...@@ -4,18 +4,18 @@ class hero: ...@@ -4,18 +4,18 @@ class hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def upgrade(self):
self.lever+=1
self.hp+=50
self.attack+=4
yase=hero('yase',300,200) yase=hero('yase',300,200)
hy=hero('hy',250,150) hy=hero('hy',250,150)
print(yase.attack) print(yase.attack)
print(hy.attack) print(hy.attack)
def upgrade():
yase.lever+=1
yase.hp+=50
yase.attack+=4
upgrade() yase.upgrade()
upgrade() yase.upgrade()
print(yase.attack) 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