Great China !!! (国旗送上)

import turtle

#the background
turtle.pensize(1)
turtle.color('red')
turtle.begin_fill()
turtle.setup(1000,1000,0,0)
turtle.penup()
turtle.goto(0,0)
turtle.pendown()
turtle.fd(300)
turtle.rt(90)
turtle.fd(200)
turtle.rt(90)
turtle.fd(300)
turtle.rt(90)
turtle.fd(200)
turtle.end_fill()

#the first star
turtle.color('yellow','yellow')
turtle.pensize(1)
turtle.begin_fill()
turtle.penup()
turtle.goto(20,-40)
turtle.seth(0)
turtle.pendown()
for i in range(5):
turtle.fd(60)
turtle.rt(144)
turtle.end_fill()

#the second star
turtle.begin_fill()
turtle.penup()
turtle.goto(110,-20)
turtle.seth(120)
turtle.pendown()
for i in range(5):
turtle.fd(20)
turtle.lt(144)
turtle.end_fill()

#the third star
turtle.begin_fill()
turtle.penup()
turtle.goto(120,-50)
turtle.seth(60)
turtle.pendown()
for i in range(5):
turtle.fd(20)
turtle.lt(144)
turtle.end_fill()

#the fourth star
turtle.begin_fill()
turtle.penup()
turtle.goto(110,-70)
turtle.seth(0)
turtle.pendown()
for i in range(5):
turtle.fd(20)
turtle.rt(144)
turtle.end_fill()

#the fifth star
turtle.begin_fill()
turtle.penup()
turtle.goto(100,-100)
turtle.seth(90)
turtle.pendown()
for i in range(5):
turtle.fd(20)
turtle.lt(144) 

turtle.end_fill()

turtle.hideturtle()
turtle.done()

原文地址:https://www.cnblogs.com/2640335699qqcom/p/12559194.html