Commit 15d03543 by BellCodeEditor

save project

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