155k views
0 votes
Give me a code that draws a house with a roof in python. Please Answer!!!

1 Answer

4 votes

import turtle

window = turtle.Screen()

tr = turtle.Turtle()

tr.forward(100)

tr.left(90)

tr.forward(100)

tr.left(90)

tr.forward(100)

tr.left(90)

tr.forward(100)

tr.back(100)

tr.left(120)

tr.forward(75)

tr.right(78)

tr.forward(60)

window.mainloop()

In my code, we use the turtle module for the graphics to draw the house with a roof.

User Shreyas Achar
by
4.5k points