用户:张嘉睿Zbym查看:4 回复:1 评论:4 创建时间:2020-06-11T20:35:47
【作品展示】

【作品介绍】
通过填充颜色画国旗。
【作品源代码】
import turtle as t
t.penup()
t.goto((-300), (-200))
t.pendown()
t.pencolor('red')
t.begin_fill()
t.fillcolor('red')
t.goto(300, (-200))
t.goto(300, 200)
t.goto((-300), 200)
t.goto((-300), (-200))
t.end_fill()
t.fillcolor("#ffff66")
t.pencolor("#ffff66")
t.penup()
t.goto((-260), 130)
t.pendown()
t.begin_fill()
for i in range(5):
t.forward(100)
t.right(144)
t.end_fill()
t.penup()
t.goto((-120), 170)
t.pendown()
t.begin_fill()
for i in range(5):
t.forward(35)
t.right(144)
t.end_fill()
t.penup()
t.goto((-90), 130)
t.pendown()
t.begin_fill()
for i in range(5):
t.forward(35)
t.right(144)
t.end_fill()
t.penup()
t.goto((-94), 90)
t.pendown()
t.begin_fill()
for i in range(5):
t.forward(35)
t.right(144)
t.end_fill()
t.penup()
t.goto((-120), 60)
t.pendown()
t.begin_fill()
for i in range(5):
t.forward(35)
t.right(144)
t.end_fill()
t.penup()
t.goto((-300), (-400))
t.pendown()
t.hideturtle()
t.done()
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn