title: Call a function in python, getting '(function) is not defined'?
body: <p>I recently started learning Python and have some code here.</p>
  
  <pre><code>...
  workout = input("Work out if you won?")
  
  if workout == "y":
      ballone()
  elif workout == "n":
      print("Okay.")
      sys.exit("Not working out if you won")
  else:
      sys.exit("Could not understand")
  
  ##Ball one
  def ballone():
  ...
  </code></pre>
  
  <p>The issue is calling 'ballone'. You can see that it is defined and works perfectly when called from the command line (ballone())</p>
  
  <p>Any ideas? I have scoured the net but cannot seem to find anything to help me. If any more code needs posting then please let me know :)</p>