Commit 31bc70f9 by BellCodeEditor

save project

parent a99b1474
Showing with 7 additions and 11 deletions
......@@ -4,17 +4,12 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
def upgrade(self):
self.level+=1
self.hp+=50
self.attack+=5
yase=Hero("亚瑟",300,20)
laoba=Hero("老八",250,25)
def upgrade():
yase.level+=1
yase.hp+=50
yase.attack+=4
upgrade()
print(yase.attack)
def upgrad():
laoba.level+=1
laoba.hp+=50
laoba.attack+=5
upgrad()
laoba.upgrade()
print(laoba.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