- 画五角星
import turtle
for i in range(5):
turtle.forward(50)
turtle.right(144) - 画同心圆
import turtle
for i in range(5):
turtle.up()
turtle.goto(50,-20*(i+1))
turtle.down()
turtle.circle(20*(i+1)) - 画太阳花
import turtle
while True:
turtle.forward(200)
turtle.right(165)
if(abs(turtle.pos()))<1:
break - 画五个五角星
import turtle
turtle.bgcolor("red")
turtle.fillcolor("yellow")
turtle.color("yellow")
def add(x,y):
turtle.up()
turtle.goto(x,y)
turtle.down()
def draw1(z):
turtle.begin_fill()
for i in range(5):
turtle.forward(z)
turtle.right(144)
turtle.end_fill()
add(-200,60)
draw1(100)
add(-90,155)
draw1(50)
add(-50,102.5)
draw1(50)
add(-50,28.5)
draw1(50)
add(-90,-20)
draw1(50) - 画◇花瓣的太阳花。
import turtle
turtle.bgcolor("orange")
turtle.color("white")
turtle.speed(10)
for i in range(1,37):
for i in range(1,3):
turtle.forward(50)
turtle.right(45)
turtle.forward(50)
turtle.right(135)
turtle.left(10)
turtle.right(90)
turtle.forward(300)