title: How can I write a simple Python try block that only check if a function returned as true?
body: <p>Pretty new to Python, trying to use a try/except block that tests if the output of a function was true or not. The function takes a simple input from the user and validates it. I want to do something like this:</p>
  
  <pre><code>try:
      if(test_function()):
      print('Input from test_function was true.')
  except:
      print('Input from test_function was false.')
  </code></pre>
  
  <p>But as you can probably see, it never hits the except portion of the code.  How can I accomplish this?</p>