title: Use 'try', 'raise', 'except' function to write a short program
body: <p>Consider a Circle class used to represent circle objects.  Instances of the Circle class will have an attribute called radius which indicates the size of the circle.  The constructor method (e.g. <strong>init</strong>) for this class will initialise this attribute as usual.</p>
  
  <p>Clearly, it doesn't make sense for a Circle object to have a size less than or equal to 0.  </p>
  
  <p>If someone attempts to create a Circle object with a negative or zero radius, then you should raise an exception of type ValueError.  The ValueError object should be created with the following string:</p>
  
  <p>Radius must not be less than or equal to 0</p>
  
  <p>In addition, If someone attempts to create a Circle object with a non-integer valued radius, then you should raise an exception of type TypeError.  The ValueError object should be created with the following string:</p>
  
  <p>Radius must be an integer value</p>
  
  <p>Define a Circle class with a constructor method that prevents Circle object being created with an invalid radius.  The <strong>repr</strong> and <strong>str</strong> functions of this class should return the following string:</p>
  
  <p>Circle(x)</p>
  
  <p>where x is the radius of the circle.</p>
  
  <p>For example:</p>
  
  <pre><code>def main():
      try:
        c = Circle(10)
      except ValueError as x:
        print("Error: " + str(x))
      else:
        print(c)
  def __init__(self, x):
      try:
        if x &lt;= 0:
          raise ValueError('Radius must not be less than or equal to 0')
        elif x != int or x != float:
          raise TypeError('Radius must be an integer value')
      except ValueError as x:
          print('Error: {0}'.format(x))
      except TypeError as x:
          print('Error: {0}'.format(x))
  main()
  </code></pre>
  
  <p>The result should be:</p>
  
  <pre><code>Circle(10)
  </code></pre>
  
  <p>If c = Circle(-100), the result should be:</p>
  
  <pre><code>Error: Radius must not be less than or equal to 0
  </code></pre>
  
  <p>However, the part of "def <strong>init</strong>(self, x)" is incorrect.
  Can somebody please help?!
  Thanks!</p>