Commit 3020c8f2 by BellCodeEditor

save project

parent 37e8d96b
Showing with 16 additions and 1 deletions
...@@ -4,12 +4,26 @@ import turtle ...@@ -4,12 +4,26 @@ import turtle
p = turtle.Pen() p = turtle.Pen()
# 设置画笔图标 # 设置画笔图标
p.shape("turtle") p.shape("turtle")
# 设置颜色
p.fillcolor("red")
# 设置画笔颜色
p.color("red")
# 开始填充颜色
p.begin_fill()
# 抬起画笔
p.penup()
# 固定画笔位置
p.setpos(-300,100)
# 落下画笔
p.pendown()
# 循环画图 # 循环画图
for i in range(5): for i in range(5):
# 移动200步 # 移动200步
p.forward(200) p.forward(100)
# 改变画笔方向 # 改变画笔方向
p.right(144) p.right(144)
# 结束填充颜色
p.end_fill()
# 隐藏画笔图标 # 隐藏画笔图标
p.hideturtle() p.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