Commit dfde4226 by BellCodeEditor

save project

parent d4dc6e84
Showing with 8 additions and 3 deletions
......@@ -3,10 +3,15 @@ with open(r'c:\Users\Windows 10\Documents\lesson13-1\sales_list.txt',"r",encodin
# for i in b:
# c=i.split()
# print(c[0])
list = []
for i in b:
c=i.split()
num=0
for q in c[1:]:
num+=int(q)
print(num)
\ No newline at end of file
# print(num)
sum=c[0]+str(num)+"\n"
list.append(sum)
with open(r'c:\Users\Windows 10\Documents\lesson13-1\sales_list.txt',"w",encoding="UTF-8") as a:
a.writelines(list)
print("over")
\ 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