Commit d7b2eae6 by BellCodeEditor

save project

parent bf5360cd
Showing with 7 additions and 6 deletions
......@@ -4,15 +4,15 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
def upgrade(self):
self.level+=1
self.hp+=50
self.attack+=4
yase=Hero('yase',300,20)
hy=Hero('hy',250,23)
k=Hero('K',5600,199)
def upgrade():
self.level+=1
self.hp+=50
self.attack+=4
upgrade()
upgrade()
yase.upgrade()
yase.upgrade()
print(yase.level)
print(yase.hp)
print(yase.attack)
\ 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