Commit e11daca3 by BellCodeEditor

save project

parent e102578b
Showing with 30 additions and 4 deletions
# _+___+__+___+_
# \\ 王者荣耀 //
# --[=========]--
class Hero:
def __init__(self,name,hp,attack):
#属性名 属性值
self.level=1 #英雄等级
self.name=name #英雄姓名
self.hp=hp #英雄血量
self.attack=attack #英雄攻击力
def upgrade():
yase.level = yase.level+1
yase.hp = yase.hp+50
yase.attack = yase.attack+10
yase=Hero('亚瑟',500,35)
houyi=Hero('后羿',350,50)
BLSY=Hero('百里守约',360,60)
CVJ=Hero('蔡文姬',500,20)
lan=Hero('澜',250,70)
print('亚瑟的生命值为',yase.hp)
print('后羿的生命值为',houyi.hp)
print('百里守约的生命值为',BLSY.hp)
print('蔡文姬的生命值为',CVJ.hp)
print('澜的生命值为',lan.hp)
悟空348诺依380小贝182李丽201宋扬107王明245李强164孙小白222苏琪137刘若若147刘阳226王胜男123王娇131
\ No newline at end of file
......@@ -5,7 +5,7 @@ with open (r'c:\Users\邢睿喆\Documents\lesson13-1\sales_list.txt','r',encodin
# data=i.split()
# print(data[0])
# print(data[1:])
final=[]
for i in a:
data=i.split()
sum=0
......@@ -14,5 +14,5 @@ for i in a:
result=data[0]+str(sum)
print(result)
final.append(result)
with open (r'c:\Users\邢睿喆\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8') as file:
a=file.readlines()
\ No newline at end of file
with open (r'c:\Users\邢睿喆\Documents\lesson13_2\2.txt','w',encoding='utf-8')'\n' as file:
file.writelines(final)
\ 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