Commit 0038b794 by BellCodeEditor

save project

parent 90346743
Showing with 8 additions and 7 deletions
file1=open(r"c:\Users\Administrator\Documents\lesson13-1\sales_list.txt","r",encoding="utf-8")
a=file1.readlines()
for i in a:
# print(i)
new_i=i.split()
sum=0
for sales in new_i[1:]:
sum=sum+int(sales)
print(sum)
\ No newline at end of file
# print(i)
new_i=i.split()
sum=0
for sales in new_i[1:]:
sum=sum+int(sales)
result=new_i[0]+str(sum)
print(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