title: Variable Referenced before Assignment Error - How to use variables across multiple functions?
body: <p>I am trying to recreate a human population simulator. It's quite basic and is currently only using 3 variables. Here is my code:</p>
  
  <pre class="lang-py prettyprint-override"><code>pop = 7000000000
  int = 5
  
  #Clear
  def cls():
      print "\n" * 80
  
  #Main script
  def MS():
      cls()
      print "Population =", pop, "Intelligence =", int
      print ""
      print "Do You:"
      print "A) Increase Population"
      print "B) Increase Intelligence"
      choice = raw_input("Option:")
      if choice == "a" :
          print "option a"
      elif choice == "A" :
          print "option A"
      elif choice == "b" :
          intel()
      elif choice == "B" :
          intel()
  
  #Increase Intelligence
  def intel():
      int = int + 3
  
  MS()
  </code></pre>
  
  <p><code>Int</code> is my intelligence variable and <code>intel</code> my intelligence increase function name. </p>
  
  <p>I want to know why I am getting the :</p>
  
  <blockquote>
    <p>"local variable 'int' referenced before assignment" Error</p>
  </blockquote>
  
  <p>when I call the int() function. How do I fix it so I'm able to use my variables in multiple functions? </p>