Commit f3dd82f9 by BellCodeEditor

save project

parent 1be16d08
Showing with 7 additions and 1 deletions
......@@ -2,7 +2,6 @@ class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
yase=Hero('亚瑟',400,20)
......@@ -10,3 +9,10 @@ houyi=Hero('后羿',250,50)
houyi.name
houyi.hp
houyi.attack
def shengji():
houyi.level = houyi.level+1
houyi.hp=houyi.hp+50
houyi.attack=houyi.attack+4
shengji()
shengji()
print(houyi.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