Python基础综合练习
import turtle def mymoto(x,y): turtle.up() turtle.goto(x,y) turtle.down() def draw(b): turtle.begin_fill() for i in range (5): turtle.forward(b) turtle.right(144) turtle.end_fill() turtle.setup(600,400,0,0) turtle.color("yellow") turtle.bgcolor("red") turtle.fillcolor("yellow") mymoto(-220,75) draw(90) for i in range(4): x=1 if i in [0, 3]: x=0 mymoto(-100+x*50,150-i*60) turtle.right(15-i*15) draw(30)
turtle.hideturtle()
turtle.done()