Commit 8256c84a by BellCodeEditor

auto save

parent 7890f63c
Showing with 6 additions and 2 deletions
with open(r'c:\Users\Administrator.USER-20190821UB\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8') as file:
a=file.readlines()
# print(a)
new_r=[]
for i in a:
data=i.split()
......@@ -8,4 +9,7 @@ for i in a:
for sales in data[1:]:
sum=sum+int(sales)
r=data[0]+str(sum)
print(r)
\ No newline at end of file
new_r+=r
# print(r)
with open(r'c:\Users\Administrator.USER-20190821UB\Documents\lesson13-1\sales_list.txt','r',encoding='utf-8') as file:
\ 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