title: Raise exception upon statement in python
body: <p>I'm new to python, and i want to make a simple bank account class, where i want to make a withdraw method, that checks if founds are sufficient and then raises an exception if not. </p>
  
  <pre><code>   def withdraw(self, amount):
          self.amount -= amount
          if amount &lt; self.amount:
              raise Exception("Insufficent founds")
          print(f"{amount} was withdrawn new balance is {self.amount}")
  </code></pre>
  
  <p>this is what i have so far, and the logic is working, but i think it would be better with a</p>
  
  <pre><code>try:
      # method logic
  except Exception:
      #handle exception and continue program
  </code></pre>
  
  <p>my issue is that i can't trigger the exception upon a statement like:</p>
  
  <pre><code>  if amount &lt; self.amount:
  </code></pre>
  
  <p>what do you do in python, when you want to throw an exception upon a certain event, and then continue the program?</p>