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,):
self.level=level
self.name=name
......@@ -8,7 +10,8 @@ class daye:
self.level+=1
self.hp+=5
self.attack+=10
wzry=daye(1,"赵云",784,243)
wzry.shengji()
wzry.shengji()
print(wzry.name,wzry.level,wzry.hp,wzry.attack)
\ No newline at end of file
timi=int(input("请输入等级-1:"))#比如:3你需要写成2
wzry=daye(1,a,784,243)
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