Commit 16bc9bc5 by BellCodeEditor

save project

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