1.画五角星
import turtle
for i in range(5): turtle.forward(100) turtle.right(144)2.画同心圆
import turtle
for i in range(5):
turtle.circle((i+1)*10)
turtle.up()
turtle.goto(0,-(i+1)*10)
turtle.down()
3.画个太阳花
from turtle import*
color('red')
fillcolor('blue')
begin_fill()
while True:
forward(200)
left(170)
if(abs(pos()))<1:
break
end_fill()
done()
4.画五个角星
import turtle
turtle.color('yellow')turtle.bgcolor('red') turtle.fillcolor('yellow')def mygoto(x,y):
turtle.up() turtle.goto(x,y) turtle.down()def ye(r):
turtle.begin_fill() for i in range(5): turtle.forward(r) turtle.right(144) turtle.end_fill()mygoto(-320,250)
ye(100)mygoto(-160,300)ye(25)mygoto(-110,250)ye(25)mygoto(-110,190)ye(25)mygoto(-160,140)ye(25)