Commit 4b28b88d by BellCodeEditor

auto save

parent f47689a4
Showing with 21 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attack):
self.leve1=1
self.name=name
self.hp=hp
self.attack=attack
def shengji(self):
yase.leve1=yase.leve1+1
yase.hp=yase.hp+70
yase.attack=yase.attack+30
yase=Hero('亚瑟',300,20)
houyi=Hero('后羿',250,35)
houyi=Hero("后羿",240,23)
houyi.shengji()
print("等级为:",houyi.level)
print("血量为:",houyi.hp)
print("攻击为:",houyi.attack)
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