import turtle turtle.setup(600, 400, 0, 0) turtle.bgcolor(‘red‘) turtle.color(‘yellow‘) turtle.fillcolor(‘yellow‘) def mygoto(x, y): turtle.up() turtle.goto(x, y) turtle.down() def draw(x): turtle.begin_fill() for i in range(5): turtle.forward(x) turtle.left(144) turtle.end_fill() mygoto(-250, 95) draw(100) for i in range(4): x=1 if i in [0, 3]: x=0 mygoto(-135+x*30, 155-i*45) # goto turtle.left(25-i*15) # 转角度 draw(30) # draw turtle.hideturtle() turtle.done()