Commit 41a8ef47 by BellCodeEditor

save project

parent fa0dff60
Showing with 39 additions and 0 deletions
# 导入库
import turtle
# 设置画笔
p = turtle.Pen()
# 抬起画笔
p.penup()
# 设置填充的颜色
p.fillcolor("red")
# 改变画笔颜色方法
p.color("red")
# 开始填充颜色
p.begin_fill()
# 固定画笔位置
p.setpos(-400,250)
# 落下画笔
p.pendown()
# 画五角星
for i in range(5):
p.forward(200)
p.right(144)
# 结束填充颜色
p.end_fill()
# 抬起画笔
p.penup()
# 移动到下一个小五角星
p.goto(-150,300)
# 落下画笔
p.pendown()
# 开始填充颜色
p.begin_fill()
# 画五角星
for i in range(5):
p.forward(50)
p.right(144)
# 结束填充颜色
p.end_fill()
# 固定画布
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