title: Python: if statement in definition causes name errors
body: <p>I have a small problem in a bigger code... I can reproduce it in the following example</p>
  
  <pre><code>def graph(form): 
      if form == single:
          print 1
      if form == multi:
          print 2
  </code></pre>
  
  <p>When I type</p>
  
  <pre><code>graph(single)
  </code></pre>
  
  <p>I get </p>
  
  <pre><code>---------------------------------------------------------------------------
  NameError                                 Traceback (most recent call last)
  &lt;ipython-input-146-c730e3c6bbf1&gt; in &lt;module&gt;()
  ----&gt; 1 graph(single)
  
  &lt;ipython-input-143-cf1ff0a5e57e&gt; in graph(form)
        5     if form == single:
        6         print 1
  ----&gt; 7     if form == multi:
        8         print 2
        9 
  
  NameError: global name 'multi' is not defined
  
  1
  </code></pre>
  
  <p>Where is my mistake?</p>