Commit bbfa184c by BellCodeEditor

save project

parent 02bc7514
Showing with 30 additions and 13 deletions
...@@ -2,15 +2,33 @@ ...@@ -2,15 +2,33 @@
使用turtle模块画图 使用turtle模块画图
每次移动都增加画笔移动的长度,并旋转91°,重复执行300次,查看效果 每次移动都增加画笔移动的长度,并旋转91°,重复执行300次,查看效果
""" """
import turtle # import turtle
t=["red","orange","yellow","green"] # t=["red","orange","yellow","green"]
pen=turtle.Pen() # pen=turtle.Pen()
# 隐藏画笔,保存画布 # # 隐藏画笔,保存画布
i=1 # i=1
for i in range(240): # for i in range(240):
pen.pencolor(t[i%4]) # pen.pencolor(t[i%4])
pen.forward(i) # pen.forward(i)
pen.right(91) # pen.right(91)
i+=1 # i+=1
pen.hideturtle() # pen.hideturtle()
turtle.done() # turtle.done()
\ No newline at end of file j=5
s=3
print(j,"*",s,"=",(j*s))
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