1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| import turtle def drawstar(x,y,c): turtle.color(c) turtle.up() turtle.goto(x,y) turtle.down() turtle.begin_fill() for i in range(5): turtle.forward(100) turtle.right(144) turtle.end_fill()
turtle.bgcolor('black') drawstar(-100,100,"yellow") drawstar(100,100,"green") drawstar(0,0,"orange") drawstar(-100,-100,"red") drawstar(100,-100,"purple") turtle.done()
|