Commit b53078a0 by BellCodeEditor

save project

parent 9bc77b45
Showing with 7 additions and 3 deletions
with open(r'c:\Users\Administrator\Documents\lesson13-1\sales_list.txt','r',encoding='UTF-8') as ftkt:
ofi=ftkt.readlines()
heyd=[]
for i in ofi:
bkgg=i.split()
#print(bkgg[1:])
sum=0
for such in bkgg[1:]:
sum=sum+int(such)
result=bkgg[0]+str(sum)
print(result)
\ No newline at end of file
result=bkgg[0]+str(sum)+"\n"
with open(r'c:\Users\Administrator\Documents\lesson13-1\sales_list.txt','r',encoding='UTF-8') as ftkt:
ftkt.writelines(result)
\ 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