用python画国旗
发布于2020-04-06 14:26
阅读(17237)
评论(0)
点赞(0)
收藏(0)
import turtle
turtle.setup(1000,600,0,0)
turtle.bgcolor("red")
turtle.fillcolor("yellow")
turtle.color('yellow')
turtle.speed(10)
#主星
turtle.begin_fill()
turtle.up()
turtle.goto(-380,120)
turtle.down()
for i in range (5):
turtle.forward(150)
turtle.right(144)
turtle.end_fill()
#第1颗副星
turtle.begin_fill()
turtle.up()
turtle.goto(-200,200)
turtle.setheading(305)
turtle.down()
for i in range (5):
turtle.forward(50)
turtle.left(144)
turtle.end_fill()
#第2颗副星
turtle.begin_fill()
turtle.up()
turtle.goto(-150,130)
turtle.setheading(30)
turtle.down()
for i in range (5):
turtle.forward(50)
turtle.right(144)
turtle.end_fill()
#第3颗副星
turtle.begin_fill()
turtle.up()
turtle.goto(-140,70)
turtle.setheading(5)
turtle.down()
for i in range (5):
turtle.forward(50)
turtle.right(144)
turtle.end_fill()
#第4颗副星
turtle.begin_fill()
turtle.up()
turtle.goto(-200,30)
turtle.setheading(300)
turtle.down()
for i in range (5):
turtle.forward(50)
turtle.left(144)
turtle.end_fill()
turtle.pensize(5)
turtle.up()
turtle.goto(80,200)
turtle.setheading(0)
turtle.down()
turtle.fd(330)
turtle.right(90)
turtle.fd(80)
turtle.right(90)
turtle.fd(330)
turtle.right(90)
turtle.fd(80)
所属网站分类:
python资源下载 >
脚本