Commit f10fa6a6 by BellCodeEditor

save project

parent d0fa6595
Showing with 7 additions and 10 deletions
......@@ -3,20 +3,16 @@ class Hero:
self.level=1
self.name=name
self.hp=hp
def upgrde(self):
self.hp += 100
yase=Hero("亚瑟",300)
hoyi=Hero("后裔",240)
def upgrde():
yase.level=yase.level+1
yase.hp=yase.hp+100
upgrde()
upgrde()
yase=Hero("亚瑟",300)
yase.upgrde()
hoyi=Hero("后裔",240)
hoyi.upgrde()
print(yase.hp)
print(hoyi.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