Commit 5db11590 by BellCodeEditor

save project

parent 5900c480
Showing with 28 additions and 2 deletions
...@@ -3,4 +3,30 @@ ...@@ -3,4 +3,30 @@
尝试让画笔重复移动36次, 尝试让画笔重复移动36次,
每次移动200步,旋转170度, 每次移动200步,旋转170度,
看看能画出什么图像吧!并尝试给它填充颜色 看看能画出什么图像吧!并尝试给它填充颜色
""" """
\ No newline at end of file #导入turtle模块
import turtle
#设置画笔
p = turtle.Pen()
#设置画笔的速度
p.speed(1000)
#设置画笔的颜色
p.color("yellow")
#填充颜色
p.fillcolor("yellow")
#开始填充
p.begin_fill()
#画笔移动36次
for i in range(36):
#画笔移动200步
p.forward(200)
#改变画笔的方向
p.left(170)
#结束填充
p.end_fill()
#隐藏画笔图标
p.hideturtle()
#固定画布
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