Commit 882c7de4 by BellCodeEditor

save project

parent af406c84
Showing with 63 additions and 0 deletions
with open('ok.txt','r',encoding='utf-8') as file:
a=file.readlines()
final_sum=[]
for i in a:
data=i.split()
sum=0
for sales in data[1:]:
sum=sum+int(sales)
result=data[0]+str(sum)+'\n'
final_sum.append(result)
with open('ok.txt','a',encoding='utf-8') as file:
file.writelines(final_sum)
\ No newline at end of file
ok 12 12 56 54
oo 55 66 87 48
op 59 87 41 12
ok134
oo256
op199
ok134
oo256
op199
ok1340
oo2560
op1990
ok134
oo256
op199
ok1340
oo2560
op1990
ok1340
oo2560
op1990
ok13400
oo25600
op19900
ok134
oo256
op199
ok1340
oo2560
op1990
ok1340
oo2560
op1990
ok13400
oo25600
op19900
ok1340
oo2560
op1990
ok13400
oo25600
op19900
ok13400
oo25600
op19900
ok134000
oo256000
op199000
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