Commit a785a2ba by BellCodeEditor

save project

parent 22354288
Showing with 19 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
def upgag(self):
selp.kc=self.kc+1
selp.kc=self.kc+300
selp.kc=self.kc+300
print("角色"+self.name+"创建成功,英雄类型为"self.hero_type)
print("当前等级,血量,攻击力为",self.levere,self.hp,self.attack)
yase=Hero('亚瑟',299,15)
nazha=Hero("哪吒",300,20)
houyi=Hero("后裔",200,25)
print(yase.attack)
print(nazha.attack)
print(houyi.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