Commit a21dbada by BellCodeEditor

save project

parent cb53eb03
Showing with 7 additions and 20 deletions
...@@ -4,28 +4,15 @@ class Hero: ...@@ -4,28 +4,15 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def upurade(self):
self.level=xyi.level+1
self.hp=xyi.hp+40
self.attack=xyi.attack+10
yase=Hero('yase',300,20) yase=Hero('yase',300,20)
hy=Hero('hy',250,23) hy=Hero('hy',250,23)
xyi=Hero('xyi',150,25) xyi=Hero('xyi',350,25)
def upurade(): hy.upurade()
xyi.level=xyi.level+1 xyi.upurade()
xyi.hp=xyi.hp+40
xyi.attack=xyi.attack+10
upurade()
upurade()
upurade()
upurade()
upurade()
upurade()
upurade()
upurade()
upurade()
upurade()
upurade()
upurade()
upurade()
upurade()
upurade()
print(xyi.level) print(xyi.level)
print(xyi.hp) print(xyi.hp)
print(xyi.attack) print(xyi.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