Commit 795da37d by BellCodeEditor

save project

parent bdf0b3d1
Showing with 19 additions and 0 deletions
import random
while True:
a=input("请输入英雄名字:")
class daye:
def __init__(self,level,name,hp,attack,):
self.level=level
self.name=name
self.hp=hp
self.attack=attack
def shengji(self):
self.level+=1
self.hp+=8*random.randint(12, 20)
self.attack+=12*random.randint(10, 20)
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