Commit bc868860 by BellCodeEditor

save project

parent 1a7f5ab5
Showing with 16 additions and 7 deletions
This diff is collapsed. Click to expand it.
...@@ -5,12 +5,21 @@ class Hero: ...@@ -5,12 +5,21 @@ class Hero:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def sj(): def ugrade(self):
yase.hp+=175 self.hp+=175
yase.level+=1 self.level+=1
yase.attack+=129 self.attack+=129
yase=Hero("亞瑟",4536,180) yase=Hero("亞瑟",4536,180)
houyi=Hero("後羿",2981,217) yase.ugrade()
sj() yase.ugrade()
print(yase.hp) yase.ugrade()
yase.ugrade()
yase.ugrade()
yase.ugrade()
yase.ugrade()
yase.ugrade()
yase.ugrade()
print("等级为:",yase.level)
print("血量为:",yase.hp)
print("攻击力为:",yase.attack)
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