Commit a38b7c02 by BellCodeEditor

save project

parent eba89e32
Showing with 10 additions and 14 deletions
...@@ -4,18 +4,14 @@ class Hero: ...@@ -4,18 +4,14 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=Hero("亚瑟",5000,600)
def upgrade(self):
self.leval+=1
self.hp+=500
self.attack+=200
libai=Hero("李白",1500,2000) libai=Hero("李白",1500,2000)
simayi=Hero("司马懿",900,1500)
liushan=Hero("刘禅",8000,900) liushan=Hero("刘禅",8000,900)
# print("亚瑟的血量为:",yase.hp) libai.upgrade()
liushan.upgrade()
# print("司马懿的血量为:",simayi.hp) print("李白的血量为:",libai.hp)
# print("刘禅的血量为:",liushan.hp) print("刘禅的血量为:",liushan.hp)
def upgrade(): \ No newline at end of file
libai.leval+=1
libai.hp+=500
libai.attack+=200
upgrade()
upgrade()
print("李白的血量为:",libai.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