Commit 4589b71d by BellCodeEditor

save project

parent 2ef374e9
Showing with 7 additions and 3 deletions
...@@ -5,6 +5,11 @@ class hero: ...@@ -5,6 +5,11 @@ class hero:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=hero("亚瑟",300,20) yase=hero("亚瑟",300,20)
hoyi=hero("后羿",250,23)
def gg():
yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+4
gg()
gg()
print("亚瑟的血量为",yase.hp) 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