title: Can I use errors as conditions for if..else statement in Python? If yes, how?
body: <p>What I am planning is when the user inputs something that results to an error (in my code, is the eval() which will cause the error in the input), it loops back. </p>
  
  <pre><code>while True:
    x = input('Enter price: ')
    y = eval(x)
    if y == #error condition
      print('Error! Please try again.')
      continue
    else:
      print(y)
      break
  </code></pre>
  
  <p>The output should be:</p>
  
  <pre><code>Enter price: +
  Error! Please try again.
  Enter price: 1+
  Error! Please try again.
  Enter price: 1+1
  2
  </code></pre>
  
  <p>Is it possible? I am using Python 3.4 btw.</p>