title: Difference between local variable and global variable
body: <p>I'm confused on the difference between local variables and global variables. I know that global variables are declared outside a function while local is declared in a function. However, I'm wondering if it is as so:</p>
  
  <pre><code>def func(l):
      a = 0
      n = len(l)
      w = l[0]
      while...
  </code></pre>
  
  <p>My question is, in the function i wrote as an example, i know that a is a local variable but what about the other two? are they local variables too?</p>