Add a method to the Turtle class to draw your initials.

Note: Each individual method ends ensuring the turtle is looking straight up so that it will work for the assumptions made by the next method.


```
class MyTurtle(Turtle):

#Assumes the turtle starts looking straight up
def drawM(self, size=60):
self.forward(size)
self.turn(150)
self.forward(size)
self.turn(-120)
self.forward(size)
self.turn(150)
self.forward(size)
self.turn(180)

#Assumes the turtle starts looking straight up
def drawJ(self, size=60):
self.forward(size/4)
self.backward(size/4)
self.turn(90)
self.forward(size/2)
self.turn(-90)
self.forward(size)
self.turn(-90)
self.forward(size/2)
self.backward(size)
self.turn(90)

#Assumes the turtle starts looking straight up
def drawG(self, size=60):
x = self.getXPos()
y = self.getYPos()
self.turn(90)
self.forward(size/2)
self.turn(-90)
self.forward(size/4)
self.turn(-90)
self.forward(size/8)
self.penUp()
self.moveTo(x,y)
self.turn(90)
self.penDown()
self.forward(size)
self.turn(90)
self.forward(size/2)
self.turn(90)
self.forward(size/8)
self.turn(180)

#Assume the turtle starts looking up
def drawInitials(self):
self.penUp()
self.moveTo(100, 150)
self.penDown()
self.drawM(100)
self.penUp()
self.moveTo(220, 150)
self.penDown()
self.drawJ(100)
self.penUp()
self.moveTo(340, 150)
self.penDown()
self.drawG(100)
```

Computer Science & Information Technology

You might also like to view...

What are the main categories of spoofing?

What will be an ideal response?

Computer Science & Information Technology

Until this chapter, we’ve found dealing with errors detected by constructors to be a bit awkward. Explain why exception handling is an effective means for dealing with constructor failure.

What will be an ideal response?

Computer Science & Information Technology

Word Web App HOME tab has ________ groups

A) 5 B) 3 C) 4 D) 6

Computer Science & Information Technology

The slide layout used to create a bulleted list is the _____.

A. Title layout B. Blank layout C. Title and Content layout D. Title Only layout

Computer Science & Information Technology