title: Python how to make an exception for non positive numbers
body: <p>How can I raise an exception here to catch nonpositive inputs? Right now nothing gets printed if I input a negative number</p>
  
  <pre><code>"""
  Generate fibonacci sequence to the nth digit
  """
  def fib(n):
      try:
          if n &lt;= 0:
              raise Exception
          prev = 0
          curr = 1
          for terms in range(0, int(n)):
              nxt = prev + curr
              print str(curr),
              prev = curr
              curr = nxt
      except ValueError or Exception:
          new = raw_input("Invalid input. Please enter a positive integer: ")
          fib(new)
  
  n = raw_input("Enter number of terms: ")
  fib(n)
  </code></pre>