Commit 20e2ab23 by BellCodeEditor

save project

parent 5ec53ebb
Showing with 14 additions and 0 deletions
with open(r'C:\Users\SONY PS5\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8')as a:
b=a.readlines()
qaz=[]
for i in b:
sum=0
x=i.split()
for j in x[1:]:
sum=sum+int(j)
__=x[0]+str(sum)+'\n'
qaz.append(__)
with open(r'C:\Users\SONY PS5\Desktop\SB.txt','w',encoding='utf-8')as wsx:
wsx.writelines(qaz)
\ 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