Commit 247137a6 by BellCodeEditor

auto save

parent ee7cdc19
Showing with 9 additions and 3 deletions
with open(r"c:\Users\admin\Documents\lesson13-1\sales_list.txt","r",encoding="utf-8") as file: with open(r"c:\Users\admin\Documents\lesson13-1\sales_list.txt","r",encoding="utf-8") as file:
a=file.read() a=file.readlines()
print(a) for i in a:
\ No newline at end of file data=i.split()
#print(data[1:])
sum=0
for b in data[1:]:
sum=sum+int(b)
new_data=data[0]+str(sum)
print(new_data)
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