title: Python local variable referenced before as assignment
body: <p>So basically i defined the variable before (globally)
  However, it still says variable referenced before assignment.</p>
  <p>I am a beginner and i dont know how to use this so please forgive me if i am doing something wrong</p>
  <pre><code>import time
  import multiprocessing
  i = True
  upgrade_level = 0
  money = 10
  
  def clear_chat():
    num = 0
    while num &lt; 100:
      print(&quot; &quot;)
      num += 1
  
  
  
  
  def loop1():
    while i:
      question = input(&quot;Would you like to upgrade? (y)\n&quot;)
      if(question.lower() == &quot;y&quot;):
        if(money &gt;= 10):
          clear_chat()
          money = money-10
          print(&quot;You upgraded once&quot;)
          print(&quot;Your upgrade level is &quot; + str(upgrade_level))
        elif(money &lt; 10):
          clear_chat()
          print(&quot;You do not have enough money ($10) to buy an upgrade&quot;)
      else:
        clear_chat()
        print(&quot;You can only input (y)&quot;)
    
  def loop2():
    while i:
      money += 10
      time.wait(10)
  
  p1 = multiprocessing.Process(target = loop1())
  p2 = multiprocessing.Process(target = loop2())
  
  </code></pre>