Commit 7293a816 by BellCodeEditor

save project

parent c8ea8038
Showing with 41 additions and 10 deletions
...@@ -2,12 +2,14 @@ with open(r"c:\Users\bellcode\Documents\lesson13-1\sales_list.txt","r",encoding= ...@@ -2,12 +2,14 @@ with open(r"c:\Users\bellcode\Documents\lesson13-1\sales_list.txt","r",encoding=
# print(bjdfkbhjkfdhvkjfd.readlines()) # print(bjdfkbhjkfdhvkjfd.readlines())
sb=bjdfkbhjkfdhvkjfd.readlines() sb=bjdfkbhjkfdhvkjfd.readlines()
sbstr=[] sbstr=[]
for i in sb: for i in sb:
sd=i.split() sd=i.split()
sum=0 sum=0
for sales in sd[1:]: for sales in sd[1:]:
sum+=int(sales) sum+=int(sales)
sss=print(sd[0]+str(sum)) sss=sd[0]+str(sum)+"\n"
sbstr.append(sss)
with open(r"jfhjkfhfjhk.txt","a") as hghg: sbstr.append(sss)
hghg.writelines(sss)
\ No newline at end of file with open(r"jfhjkfhfjhk.txt","a",encoding="utf-8") as hghg:
hghg.writelines(sbstr)
\ No newline at end of file
王娇131
王娇131
悟空348
诺依380
小贝182
李丽201
宋扬107
王明245
李强164
孙小白222
苏琪137
刘若若147
刘阳226
王胜男123
王娇131
悟空348
诺依380
小贝182
李丽201
宋扬107
王明245
李强164
孙小白222
苏琪137
刘若若147
刘阳226
王胜男123
王娇131
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