import turtle # HW #3, CSCI 1470.2 Spring 2026. def draw_house(): # Set up the screen screen = turtle.Screen() screen.setup(width=500, height=400) # Set screen size (width x height) screen.bgcolor("white") screen.title("A simple Turtle house") # Set up the turtle t = turtle.Turtle() t.speed(2) t.penup() # So not to draw while the turtle moves. t.goto(-75, -150) # Start position for lower left corner of the house base t.pendown() # Draw the main body of the house. t.fillcolor("lightblue") t.begin_fill() # to be filled with a light blue color. t.forward(150) t.left(90) t.forward(180) t.left(90) t.forward(150) t.left(90) t.forward(180) t.left(90) t.end_fill() # Draw the roof (a triangle) t.penup() t.goto(-75, 30) # Move to the top left corner of the square t.pendown() t.fillcolor("sienna") t.begin_fill() t.forward(150) t.left(120) t.forward(150) t.left(120) t.forward(150) t.left(120) t.end_fill() # Draw the door t.penup() t.goto(-20, -150) # Position for the door t.pendown() t.fillcolor("sienna") t.begin_fill() t.forward(40) t.left(90) t.forward(70) t.left(90) t.forward(40) t.left(90) t.forward(70) t.left(90) t.end_fill() # Draw the left window t.penup() t.goto(-50, -40) # lower left corner position for the left window t.pendown() t.fillcolor("azure") t.begin_fill() t.forward(30) t.left(90) t.forward(30) t.left(90) t.forward(30) t.left(90) t.forward(30) t.left(90) t.end_fill() # Draw the right window t.penup() t.goto(20, -40) # lower left corner position for the right window t.pendown() t.fillcolor("azure") t.begin_fill() # It is also acceptable if you use a for loop to draw the four sides of the windows. for _ in range(4): t.forward(30) t.left(90) t.end_fill() # Hide the turtle and keep the window open t.hideturtle() screen.mainloop() if __name__ == "__main__": # call the main function, draw_house. draw_house()