1.用循环画五角星

import turtle
turtle.setup(600,400,0,0)
turtle.color("yellow")
turtle.bgcolor('red')
turtle.fillcolor("yellow")
turtle.up()
turtle.goto(-250,75)
turtle.down()
turtle.begin_fill()
for i in range(5):
turtle.forward(100)
turtle.right(144)
turtle.end_fill()

2.用循环画同心圆

from turtle import*
for i in range(5):
up()
goto(0,-20*(i))
down()
circle(20*i)

3.用while循环画太阳花

from turtle import*

color('red','blue')
begin_fill()
while True:
forward(200)
left(170)
if (abs(pos()))<1:
break
end_fill()
done()

4.用函数定义画五个五角星
import turtle
turtle.setup(600,400,0,0)
turtle.color("yellow")
turtle.bgcolor('red')
turtle.fillcolor("yellow")
turtle.up()
turtle.goto(-250,75)
turtle.down()
turtle.begin_fill()
for i in range(5):
turtle.forward(100)
turtle.right(144)
turtle.end_fill()

turtle.up()
turtle.goto(-100,-10)
turtle.down()
turtle.begin_fill()
for i in range(5):
turtle.forward(50)
turtle.left(144)
turtle.end_fill()

turtle.up()
turtle.goto(-50,50)
turtle.down()
turtle.begin_fill()
for i in range(5):
turtle.forward(50)
turtle.right(144)
turtle.end_fill()

turtle.up()
turtle.goto(-50,120)
turtle.down()
turtle.begin_fill()
for i in range(5):
turtle.forward(50)
turtle.right(144)
turtle.end_fill()

turtle.up()
turtle.goto(-100,160)
turtle.down()
turtle.begin_fill()
for i in range(5):
turtle.forward(50)
turtle.left(144)
turtle.end_fill()

turtle.color("red")

5.用函数定义画钻石花瓣的太阳花
import turtle

def draw_art():

window=turtle.Screen()
window.bgcolor("purple")

for i in range(0,36):

window.exitonclick()

draw_art()