Commit abf9421e by BellCodeEditor

save project

parent 323fb8dc
Showing with 15 additions and 22 deletions
# 悟空想海龟作图画出弹簧隧道,但是出现了bug,运行不了,请你帮助他,修改bug~
import turtle
pen=turtle.Pen()
screen=turtle.Screen()
pen.speed('fast')
pen.speed(10)
pen.hideturtle()
screen.bgcolor('black')
i=0
while i<135:
pen.pencolor('pink')
pen.penup()
pen.goto(0,0)
pen.forward(200)
pen.pendown()
pen.circle(100)
pen.left(2)
i+=1
turtle.done()
with open(r"c:\Users\玛酷机器人\Desktop\新建文本文档.txt","r",encoding="utf-8") as a:
e=""
for i in a:
b=i.split()
# print(b)
c=0
d=b[0]
for i in b[1:]:
c+=int(i)
e+=d+str(c)+"\n"
# print(e)
print(e)
with open(r"c:\Users\玛酷机器人\Desktop\新建文本文档.txt","w",encoding="utf-8") as f:
f.write(e)
\ 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