
Homework
So we created the function called rectangle below. Rather than figuring out multiple different turtle .forward, .left, and .right , lets use are new rectangle to draw shapes! as long as the shape can be made with rectangles, we can make it to !
Your mission is to draw the letter E only using the rectangle function. Adjust the x,y,length,width, and color as needed and multiple rectangles to create a capital E.
A secondary goal, is to create the DRAW_E function, which will take an x and a y (and color if you would like) and draw it in that location. You can do it! it is very similar to last weeks homework/lesson.
def rectangle(x,y,length,width, color):
turtle.penup()
turtle.goto(x,y)
turtle.pendown()
turtle.color(color)
turtle.begin_fill()
turtle.forward(width)
turtle.left(90)
turtle.forward(length)
turtle.left(90)
turtle.forward(width)
turtle.left(90)
turtle.forward(length)
turtle.left(90) # we need reset the arrow
turtle.end_fill()
rectangle(-100,0,200,75,”red”)