Commit 568c326a by BellCodeEditor

save project

parent 95cc9288
Showing with 14 additions and 12 deletions
file=open(r'C:\Users\86185\Desktop\sales_list.txt','r',encoding='utf-8') class Hero:
a=file.readlines() def __init__(self):
final_sum=[] self.level=1
for i in a: self.Hp=300
sad=i.split() self.attack=20
sum=0 yase=Hero()
for sales in data[1:] print(yase.level,yase.Hp,yase.attack)
sum=sum+int(sales)
result=data[0]+str(sum)
print(result)
with open(r'C:\Users\86185\Desktop\sales_list.txt','a',encoding='utf-8')
file.writelines(final_sum)
......
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