Commit 450a1d95 by BellCodeEditor

auto save

parent 5ec53ebb
Showing with 22 additions and 0 deletions
with open(r'c:\Users\vv\Desktop\义卖表.txt','r'encoding='utf-8')as file:
a=file.readlines()
# print(type(a[3:5]))
# print(a)
fike=[]
for i in a:
p=i.split()
# print(p[1:])
sum=0
for j in p[1:]:
sum+=int(j)
result=p[0]+str(sum)+'\n'
print(result)
fike.append(result)
#with open(r'c:\Users\vv\Desktop\义卖款总和.txt','a',encoding='utf-8')as fileq:
# fileq.writelines(fike)
\ No newline at end of file
a=['你好呀\n','悟空\n','我在贝尔学python\n']
with open(r'c:\Users\vv\Desktop\helo.txt','a',encoding='utf-8')as five:
five.writelines(a)
\ 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