import turtle def draw_polygon(my_turtle, sides, size): '''draw_polygon function accepts an instance of turtle, and draws a polygon of a given sides and size''' angle = 360.0 / sides for i in range(sides): if my_turtle.color()[0] == "red": my_turtle.color("black") else: my_turtle.color("red") my_turtle.forward(size) my_turtle.left(angle) # our main code wn = turtle.Screen() wn.bgcolor("lightblue") dana = turtle.Turtle() draw_polygon(dana, 6, 100) dana.right(180) draw_polygon(dana, 5, 100) # wn.mainloop() turtle.done()