Commit b703ec9f by BellCodeEditor

save project

parent 23368526
Showing with 10 additions and 1 deletions
...@@ -3,4 +3,13 @@ with open(r'c:\Users\Windows\Documents\lesson13-1\sales_list.txt',"r", encoding= ...@@ -3,4 +3,13 @@ with open(r'c:\Users\Windows\Documents\lesson13-1\sales_list.txt',"r", encoding=
for i in a: for i in a:
#print(a) #print(a)
data = i.split() data = i.split()
print(data[1:]) #print(data[1:])
sum = 0
for j in data[1:]:
sum += int(j)
b = data[0] +str(sum)
result = data[0] + str(sum) + "\n"
list1.append(result)
with open(r'c:\Users\Windows\Documents\lesson13-1\sales_list.txt',"w", encoding="utf-8") as filel:
a = filel.readlines()
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