Add a method to the Turtle class to draw a simple house. It can have a rectangle for the house and an equilateral triangle as the roof.

Note: New method at bottom


```
class MyTurtle(Turtle):

#Assumes the turtle starts looking straight up
def drawTri(self, size=60):
self.turn(30)
for i in range(3):
self.forward(size)
self.turn(120)

#Assumes the turtle starts looking straight up
def drawRect(self, width=100, height = 100):
self.turnRight()
self.forward(width)
self.turnRight()
self.forward(height)
self.turnRight()
self.forward(width)
self.turnRight()
self.forward(height)

#Assumes the turtle starts looking straight up
def drawHouse(self, width=100, height=100):
self.drawRect(width,height)
self.drawTri(width)
```

Computer Science & Information Technology

You might also like to view...

In addition to its primary layers, most operating systems incorporate a set of __________ routines such as linkage editors, loaders, line editors, disk formatting routines, sort routines, debugging features, library management routines, and so on.

a. resident b. utility c. add-on d. optional

Computer Science & Information Technology

To remove two nodes node1 and node2 from a pane, use ______.

a. pane.remove(node1, node2); b. pane.removeAll(node1, node2); c. pane.getChildren().remove(node1, node2); d. pane.getChildren().removeAll(node1, node2);

Computer Science & Information Technology

When you add a graphic to a Web site, it should be stored in the ____ folder within the root folder of the site.

A. graphics B. pictures C. photos D. media

Computer Science & Information Technology

In the accompanying figure, an example of an element from the students vocabulary is _____.

A. firstName B. student C. instructor D. name

Computer Science & Information Technology