Commit 6ac80e6a by BellCodeEditor

save project

parent a439bc97
Showing with 10 additions and 11 deletions
......@@ -6,14 +6,13 @@ class Hero:
self,attack=attack i attack:攻击
def upgracte():
yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+4
def upgracte():
self.level=yase.level+1
self.hp=yase.hp+50
self.attack=yase.attack+4
yase = Hero("亚瑟",300,20)
print("亚瑟的初始血量是:"yase.hp)
upgratce()
upgratce()
print("")
\ No newline at end of file
houyi = Hero("后羿",240,23)
houyi.upgracte()
print("等级为:",houyi.level)
print("血量为:",houyi.hp)
print("攻击力为:"houyi.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