title: Order of execution and style of coding in Python
body: <p>I am new to Python so please don't flame me if the question is too basic :)</p>
  
  <p>I have read that Python is executed from top - to - bottom.</p>
  
  <p>If this is the case, why do programs go like this:</p>
  
  <pre><code>def func2(): 
      pass
  
  def func1():
      func2()
  
  def func():
      func1()
  
  if __name__ == '__main__':
      func()
  </code></pre>
  
  <p>So from what I have seen, the main function goes at last and the other functions are stacked on top of it. </p>
  
  <p>Am I wrong in saying this? If no, why isn't the main function or the function definitions written from top to bottom?</p>
  
  <p>EDIT: I am asking why I can't do this:</p>
  
  <pre><code>if __name__ == '__main__':
      func()
  
  def func1():
      func2()
  </code></pre>
  
  <p>Isn't this the natural order? You keep on adding stuff at the bottom, since it is executed from top to bottom.</p>