title: How to fix the AttributeError: 'str' object has no attribute '_radius'?
body: <p>I have this python code which seem very straight forward but when I try to load it I get an error as above. you can view the full error message below too. Please what am I doing wrong? Thanks you.</p>
  
  <pre><code>import math
  
  class Circle2D(object):
      def __init__(self, x = 0, y = 0, radius = 0):
          self._x = x
          self._y = y
          self._radius = radius
      def __str__(self):
          return "Circle with center (" + str(self._x) + ", " + str(self._y) + ")"
      def getX(self):
          return self._x
      def getY(self):
          return self._y
      def getArea(self):
          return (math.pi * self._radius**2)
      def getPerimeter(self):
          return (math.pi * 2 *self._radius)
      def containsPoint(self, x, y):
          if (((x - self._x)**2 - (y - self._y)**2) &lt; self._radius**2):
              return True
          else:
              return False
      def contains(self, second):
          distance = math.sqrt((self._x - second._x)**2 + (self._y - second._y)**2)
          if ((second._radius + distance) &lt;= self._radius):
              return True
          else:
              return False
      def overlaps(self, second):
          distance = math.sqrt((self._y - second._y)**2 + (self._x - second._x)**2)
          if (distance &lt;= (self._radius + second
                           ._radius)):
              return True
          else:
              return False
      def __contains__(self, anotherCircle):
          distance = math.sqrt((self._x - anotherCircle._x)**2 + (self._y - anotherCircle._y)**2)
          if(self._radius &gt;= (anotherCircle._radius + distance)):
              return True
          else:
              return False
      def __cmp__(self, anotherCircle):
          if self._radius &gt; anotherCircle._radius:
              return 1
          elif self._radius &gt; anotherCircle._radius:
              return -1
          else:
              return 0
      def __eq__(self, anotherCircle):
         if self._radius == anotherCircle._radius:
             return True
         else:
              return False
      def __ne__(self, anotherCircle):
          if self._radius == anotherCircle._radius:
             return False
          else:
              return True
  </code></pre>
  
  <p>when i runn it and after few steps, the shell just shows:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\wxwdd_000\Desktop\HW_2.py", line 124, in &lt;module&gt;
      main()
    File "C:\Users\wxwdd_000\Desktop\HW_2.py", line 121, in main
      print 'c1 == "Hello"?', c1 == "Hello"
    File "C:\Users\wxwdd_000\Desktop\HW_2.py", line 57, in __eq__
      if self._radius == anotherCircle._radius:
  AttributeError: 'str' object has no attribute '_radius'
  </code></pre>
  
  <p>how can i fix the code?</p>