import turtle #画一个五角星 turtle. setup(600,400,0,0) turtle.bgcolor('red') turtle.pencolor('yellow') turtle.fillcolor('yellow') def mygoto(x,y): turtle.penup() turtle.goto(x,y) turtle.pendown() mygoto(-250,100) turtle.begin_fill() for i in range(5): turtle.forward(100) turtle.right(144) turtle.end_fill() def mygoto(x,y): turtle.penup() turtle.goto(-125,150) turtle.pendown() mygoto(-250,100) turtle.begin_fill() for i in range(5): turtle.forward(50) turtle.right(144) turtle.end_fill() def mygoto(x,y): turtle.penup() turtle.goto(-75,110) turtle.pendown() mygoto(-250,100) turtle.begin_fill() for i in range(5): turtle.forward(50) turtle.right(144) turtle.end_fill() def mygoto(x,y): turtle.penup() turtle.goto(-75,55) turtle.pendown() mygoto(-250,100) turtle.begin_fill() for i in range(5): turtle.forward(50) turtle.right(144) turtle.end_fill() def mygoto(x,y): turtle.penup() turtle.goto(-125,25) turtle.pendown() mygoto(-250,100) turtle.begin_fill() for i in range(5): turtle.forward(50) turtle.right(144) turtle.end_fill() hideturtle() turtle.done()
转载于:https://www.cnblogs.com/Millie/p/9048238.html