title: What is the best way to exit a function (which has no return value) in python before the function ends (e.g. a check fails)?
body: <p>Let's assume an iteration in which we call a function without a return value. The way I think my program should behave is explained in this pseudocode:</p>
  
  <pre><code>for element in some_list:
      foo(element)
  
  def foo(element):
      do something
      if check is true:
          do more (because check was succesful)
      else:
          return None
      do much much more...
  </code></pre>
  
  <p>If I implement this in python, it bothers me, that the function returns a <code>None</code>. Is there a better way for "exiting a function, that has no return value, if a check fails in the body of the function"?</p>