title: Mandelbrot Sequence with Python's Turtle
body: <p>I am trying to draw the mandelbrot sequence with python's turtle graphics. I am using two classes, one to represent the mandelbrot sequence.</p>
  
  <pre><code>class Mandelbrot:
  def __init__(self,c,limit=50):
      self.__limit = int(limit)
      self.__colormap = ['black','white']
      self.__cardinality = limit
      z = 0
      for i in range(limit):
          z = z * z + c
  
  
          if abs(z) &gt; 2:
              self.__cardinality = i
              return
  
  
  
  def getColor(self):
      if self.__cardinality == self.__limit:
          return self.__colormap[0]
      return self.__colormap[1]
  </code></pre>
  
  <p>The other class represents the turtle display.            </p>
  
  <pre><code>import turtle
  from mandelbrot import *
  
  class Display:
      def __init__(self):
          self.t = turtle.Turtle()
          self.t.ht();self.t.turtlesize(1)
          self.t.speed(0)
          turtle.tracer(2000,0)
  
  
      for x in range(-150,151):
          for y in range(-150,151):
              self.t.color(Mandelbrot(turtleConvert(x,y)).getColor())
              self.t.goto(x,y)
  
  
  
  def turtleConvert(x,y): #converts from turtle pixels to the complex plane
      return complex((x/300)*4,(y/300)*4)
  </code></pre>
  
  <p>When I make an instance of the display class, the program runs but only prints the lower half of the fractal. Could anyone provide a solution?</p>
  
  <p>This is a picture of my result.</p>
  
  <p><img src="https://i.stack.imgur.com/X5wnl.png" alt="Fractal"></p>