Commit 6fa475bc by BellCodeEditor

save project

parent d6c81a0f
Showing with 19 additions and 0 deletions
class Hero:
def __init__(self,nema,hp,ad):
self.level = 1
self.nema = nema
self.hp = hp
self.ad = ad
yase = Hero("亚瑟",300,20)
def upgreat():
yase.level = yase.level+1
yase.hp = yase.hp+50
yase.ad = yase.ad+4
upgreat()
upgreat()
upgreat()
upgreat()
upgreat()
print("亚瑟的等级为:",yase.level)
print("亚瑟的血量为:",yase.hp)
print("亚瑟的攻击为:",yase.ad)
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