Commit 5162746d by BellCodeEditor

auto save

parent 9fa97cf6
Showing with 18 additions and 1 deletions
......@@ -5,8 +5,11 @@
import turtle
pen = turtle.Pen()
pen.speed(0)
# 请创造师在下面接着创作
for i in range(300):
pen.forward(i)
pen.left(91)
......
with open(r'c:\Users\SYT\Desktop\a.txt','r',encoding="utf-8") as fw:
a = fw.readlines()
fin_sum = []
for i in a:
data = i.split()
sum = 0
for j in data[1:]:
print(j)
sum += int(j)
fin_sum.append(data[0]+":"+str(sum)+"\n")
with open(r'c:\Users\SYT\Desktop\b.txt','w',encoding="utf-8") as f:
b = f.writelines(fin_sum)
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