Skip to main content
Turtle exercise

Flag of Belgium with a function

Sign in to hand in your solution and get feedback.

import turtle as otto def draw_rectangle(x0, y0, width, height, pencolor, fillcolor): otto.penup() otto.goto(x0, y0) otto.pendown() otto.pencolor(pencolor) otto.fillcolor(fillcolor) otto.begin_fill() for side in range(2): otto.forward(width) otto.right(90) otto.forward(height) otto.right(90) otto.end_fill()