Commit 07fc7ca2 by BellCodeEditor

save project

parent 34a452b7
Showing with 15 additions and 10 deletions
class hero:
def __init__(self,name,hp,attack):
self.level = 1
self.name = name
self.hp = hp
self.attack = attack
def upgrade():
ys.level=ys.level+1
ys.hp=ys.hp+50
ys.attack=ys+10
file_sum ys = hero("ys",300,20)
fot i in a print("ys的初始血量为:"ys.hp)
data=i.split upgarde()
str=0 upgarde()
for sales in data[1:] print("ys升级二次后血量为:"ys.hp)
sum=sum+int(sales)
reilt=data[0:]+str(sun)+file_sum
print(reilt)
file writelens(file_sum)
\ 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