Commit 0422f7f7 by BellCodeEditor

save project

parent d1536a55
Showing with 26 additions and 0 deletions
with open(r"C:\Users\EDZ\Documents\lesson13-5\sales_list.txt","r",encoding="utf-8")as file1:
data=file1.readlines()
b=[]
for i in data:
a=i.split()
sum=0
for j in a[1:]:
sum=sum+int(j)
b.append(a[0]+str(sum)+"\n")
with open(r"C:\Users\EDZ\Documents\lesson13-5\sales_list.txt","w",encoding="utf-8")as file2:
file2.writelines(b)
\ No newline at end of file
悟空3480
诺依3800
小贝1820
李丽2010
宋扬1070
王明2450
李强1640
孙小白2220
苏琪1370
刘若若1470
刘阳2260
王胜男1230
王娇1310
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