Commit 8289f509 by BellCodeEditor

save project

parent 6986aef2
Showing with 6 additions and 7 deletions
......@@ -4,15 +4,15 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
def upgrade(self):
self.level += self.level
self.hp = self.hp + 100
self.attack = self.attack + 5
yase=Hero('牙色',300,20)
hy=Hero('吼议',250,23)
k=Hero('慨',5600,199)
k.upgrade()
print(yase.attack)
print(hy.attack)
print(k.attack)
def upgrade():
yase.level += yase.level
yase.hp = yase.hp + 100
yase.attack = yase.attack + 5
upgrade()
print(yase.hp)
\ 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