1太阳花
from turtle import*
color('yellow','yellow')
begin_fill()
while True:
forward(100)
left(170)
if(abs(pos()))<1:
break
end_fill()
done()
2同心圆
from turtle import*
for i in range(5):
up()
goto(0,-20*(1+i))
down()
circle(20*(i+1))
write(10-i)
3国旗
import turtle
turtle.color('yellow')
turtle.bgcolor('red')
turtle.fillcolor('yellow')
turtle.speed(50)
def mygoto(x,y):
turtle.up()
turtle.goto(x,y)
turtle.down()
turtle.begin_fill()
mygoto(-230,100)
for i in range(5):
turtle.forward(200)
turtle.left(144)
turtle.end_fill()
turtle.begin_fill()
mygoto(-70,250)
for i in range(5):
turtle.forward(50)
turtle.left(144)
turtle.end_fill()
turtle.begin_fill()
mygoto(0,150)
for i in range(5):
turtle.forward(50)
turtle.left(144)
turtle.end_fill()
turtle.begin_fill()
mygoto(-70,-50)
for i in range(5):
turtle.forward(50)
turtle.left(144)
turtle.end_fill()
turtle.begin_fill()
mygoto(0,50)
for i in range(5):
turtle.forward(50)
turtle.left(144)
turtle.end_fill()
4,五角星
import turtle
for i in range(5):
turtle.forward(200)
turtle.left(144)
效果图: