Commit f338de33 by BellCodeEditor

save project

parent 99c773fe
Showing with 5 additions and 6 deletions
...@@ -3,13 +3,12 @@ class Hero: ...@@ -3,13 +3,12 @@ class Hero:
self.level = 1 self.level = 1
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def upd(self):
self.hp+=1
self.hp+=50
yase = Hero("亚瑟",300,20) yase = Hero("亚瑟",300,20)
print("亚瑟的初始血量为:",yase.hp) yase.upd()
yase.upd()
def upd( ):
yase.hp+=50
upd()
upd()
print("神级2次后,亚瑟的血量值为:",yase.hp) print("神级2次后,亚瑟的血量值为:",yase.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