Commit af0a6932 by BellCodeEditor

save project

parent f8eb655a
Showing with 6 additions and 7 deletions
......@@ -4,6 +4,10 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
def upgrade(self):
self.level=yase.level+1
self.hp=yase.hp+50
self.attack=yase.attack+20
yase=Hero('yase',300,20)
hy=Hero('hy',250,23)
......@@ -12,13 +16,8 @@ print(yase.attack)
print(hy.attack)
print(k.attack)
def upgrade():
yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+20
upgrade()
upgrade()
yase.upgrade()
yase.upgrade()
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