Commit 3f9c2da4 by BellCodeEditor

save project

parent 489acc90
Showing with 16 additions and 0 deletions
class Hero:
def __init__(self,name, Hp ,attack):
self.level=1
self.Hp=Hp
self.attack=attack
wen= Hero("温",500,30)
xu= Hero("絮",500,20)
print("温的血量",wen.Hp)
print("絮的血量",xu.Hp)
def shengji(:
yase.level = yase.level + 1
yase.Hp = yase.Hp + 3
yase.attack = yase.attack + 1
shengji()
print("温的初始血量:",wen.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