title: "Enabling" comparison for classes
body: <p>I would like some help on my CSC HW. It is on classes/objects, and it's a simple class on defining a circle, with the name class Circle(object).</p>
  
  <p>The exact text of the HW (I completed the first two parts of this hw and thus this 3rd part is an expansion on the initial problem):</p>
  
  <p>"""Expand on your Circle class by enabling the comparison of Circle objects using operators such as &lt;, >, >=, &lt;=, ==, and !=, where one Circle is considered "larger" than another if it is in fact larger (i.e., has greater area) the other Circle.</p>
  
  <p>The following code:</p>
  
  <pre><code>A = Circle(2, 5, 1.5)
  B = Circle(-6, 1, 1)
  print A &lt; B, A != B, A &gt;= B
  </code></pre>
  
  <p>Should generate this output:</p>
  
  <pre><code>False True True
  </code></pre>
  
  <p>This is my code for displaying the coordinates and radius of the circle:</p>
  
  <pre><code>class Circle(object):
      def __init__(self, x=0, y=0, r=0):
          self.x = x
          self.y = y
          self.r = r
      def __str__(self):
          return "Circle at (%d , %d). Radius: %f" % (self.x, self.y, self.r)
  
  def main():
      print Circle(3, 5, 4.0)
  
  main()
  </code></pre>
  
  <p>The output of this class is "Circle at (3 , 5). Radius: 4:000000"</p>
  
  <p>We were pointed to a certain page of our textbook with math operators for classes:
  <strong>eq</strong>(), <strong>gt</strong>(), <strong>ge</strong>(), <strong>lt</strong>(), <strong>le</strong>(), <strong>ne</strong>(), etc.
  So I was thinking, did my professor want something like this?</p>
  
  <pre><code>import math
  class Circle(object):
      def __init__(self, x=0, y=0, r=0):
          self.x = x
          self.y = y
          self.r = r
      def __str__(self):
          return "Circle at (%d , %d). Radius: %f" % (self.x, self.y, self.r)
      def calcArea(self, r):
          self.r = r
          return (math.pi)*(r**2)
      def __gt__(self, circ1Radius, circ2Radius)
          self.circ1Radius = circ1Radius
          self.circ2Radius = circ2Radius
          r1 = circ1Radius
          r2 = circ2Radius
          r1 &gt; r2 or r2 &gt; r1
      def __ge__(self, circ1Radius, circ2Radius)
      #And so on for __lt__(), __le__(), __ne__(), etc
  def main():
      A = Circle(3,4,1.5) 
      B = Circle(1,2,5.0)
      C = Circle(5,7,7) 
      D = Circle(9,8,3)
      print A &lt; B, B &gt; C, A &lt; C, A &gt;= C
  main()
  #Output should be "True, False, True, False"
  </code></pre>
  
  <p>Do we have to make a definition/attribute for each method we want to use in the class? Thank you in advance. </p>