Commit 4b4a8b8a by BellCodeEditor

save project

parent df240a06
Showing with 31 additions and 13 deletions
""" for B in range(1,10):
使用turtle模块画图 for C in range(1,B+1):
每次移动都增加画笔移动的长度,并旋转91°,重复执行300次,查看效果
"""
import turtle
pen = turtle.Pen() print("%d#%d=%2d"%(B,C,B*C),end=" ")
# 请创造师在下面接着创作 print()
distance=1
for i in range(300):
pen.forward(distance) import turtle
distance+=1 turtle.screensize(400,300,"black")
pen.right(121)
# 隐藏画笔,保存画布 pen= turtle.Pen()
pen.speed(0)
pen.shape("turtle")
color_list=["blue","cyan","pink","orange"]
A=1
for times in range(100):
pen.forward(A)
pen.pencolor(color_list[times%4])
pen.right(90.5)
A+=1
for times in range(100):
pen.forward(A)
pen.pencolor(color_list[times%4])
pen.right(91)
A+=1
for times in range(100):
pen.forward(A)
pen.pencolor(color_list[times%4])
pen.right(91.5)
A+=1
pen.hideturtle() pen.hideturtle()
turtle.done() turtle.done()
\ 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