Commit 16bc9bc5 by BellCodeEditor

save project

parent 24785ed0
Showing with 18 additions and 15 deletions
class daye: while True:
def __init__(self,level,name,hp,attack,): a=input("请输入英雄名字:")
self.level=level class daye:
self.name=name def __init__(self,level,name,hp,attack,):
self.hp=hp self.level=level
self.attack=attack self.name=name
def shengji(self): self.hp=hp
self.level+=1 self.attack=attack
self.hp+=5 def shengji(self):
self.attack+=10 self.level+=1
wzry=daye(1,"赵云",784,243) self.hp+=5
wzry.shengji() self.attack+=10
wzry.shengji() timi=int(input("请输入等级-1:"))#比如:3你需要写成2
print(wzry.name,wzry.level,wzry.hp,wzry.attack) wzry=daye(1,a,784,243)
\ No newline at end of file for i in range(timi):
wzry.shengji()
print(wzry.name,"的资料为:","等级",wzry.level,"血量",wzry.hp,"攻击力",wzry.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