Commit 455661df by BellCodeEditor

save project

parent 0ed2f19c
Showing with 13 additions and 5 deletions
......@@ -4,7 +4,15 @@ class Hero():
self.level=level
self.hp=hp
self.attack=attack
Lan=Hero('澜',7,50,100)
WuKong=Hero('孙悟空',5,80,50)
print(Lan.hp)
print(WuKong.hp)
\ No newline at end of file
Lan=Hero('澜',1,100,400)
WuKong=Hero('孙悟空',1,220,210)
XiaoLuBan=Hero('小鲁班',1,130,200)
print(Lan.name,Lan.level,Lan.hp,Lan.attack)
print(WuKong.hp)
def up():
Lan.level=Lan.level+1
Lan.hp=Lan.hp+6
Lan.attack=Lan.attack+20
up()
print(Lan.name,Lan.level,Lan.hp,Lan.attack)
\ 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