Add a method to the Turtle class to draw a street of houses.
Note: New method at bottom, and changed drawTri slightly to end with the turtle looking straight up. The drawHouses method could also have variables passed in to determine the make up of the street of houses instead of having them hardcoded in.
```
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)
self.turn(-30)
#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)
#Assumes the turtle starts looking straight up
def drawHouses(self):
self.penUp()
self.moveTo(100, 100)
self.penDown()
self.drawHouse(100, 60)
self.penUp()
self.moveTo(300,100)
self.penDown()
self.drawHouse(80,60)
self.penUp()
self.moveTo(450,100)
self.penDown()
self.drawHouse(110,60)
```
You might also like to view...
An emerging standard of wireless Ethernet, also known as 802.11ad, is
a. WiGig. b. Low Power WiFi. c. White-Fi. d. Super WiFi.
Message boards are only used for informal events and are not considered a possible business communication media
Indicate whether the statement is true or false
You can spell-check an entire presentation by pressing the _____ key.
A. F2 B. F7 C. F9 D. F11
The command find . name "?" print
a: starts from the current directory, and finds all files with filename ? b: starts from the home directory, and finds all files with filename ? c: starts from the root directory, and finds all files that have a ? mark as part of their filenames d: starts from the current directory, and finds all files with one character filename e: none of the above