Commit 771e4f2b by BellCodeEditor

save project

parent 8ba4f0be
Showing with 11 additions and 7 deletions
......@@ -4,16 +4,20 @@ class Hero():
self.hp=hp
self.attack=attack
self.name=name
def upgrade(self):
self.level+=1
self.hp+=300
self.attack+=79
yasi=Hero("yasi",3000,389)
houyi=Hero("houyi",2500,585)
# print(houyi.hp)
def upgrade():
yasi.level+=1
yasi.hp+=300
yasi.attack+=79
upgrade()
upgrade()
yasi.upgrade()
houyi.upgrade()
print(yasi.hp)
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