Commit 3bcbcac7 by BellCodeEditor

save project

parent 95bc707e
Showing with 17 additions and 2 deletions
with open(r"C:\Users\user\Desktop\sales_list.txt","r",encoding='utf-8') as fill:
a=fill.readlines()
for i in a:
data=i.split()
#print(data[1:])
s=0
for l in data[1:]:
s=s+int(l)
q=data[0]+':'+str(s)
print(q)
\ No newline at end of file
......@@ -3,7 +3,11 @@ with open(r"C:\Users\user\Desktop\sales_list.txt","r",encoding='utf-8') as fill:
for i in a:
data=i.split()
#print(data[1:])
f=[]
s=0
for l in data[1:]:
s=s+int(l)
print(s)
\ No newline at end of file
q=data[0]+':'+str(s)+'/n'
f.append(q)
with open(r"C:\Users\user\Desktop\去你妈的.txt","r",encoding='utf-8') as fill:
f=fill.readlines()
\ 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