title: free variable referenced before assignment in enclosing scope
body: <p>Hey im having some trouble understanding what I did wrong/finding a way to fix it, can you guys help me?</p>
  <pre><code>def main():
      Keys = 0
      def Function1():
          global all
          def Function2():
              global all
              print(str(Keys))
          Function2()
          Keys = Keys + 1
      Function1()
  main()
  </code></pre>
  <p>every time i try to run this i get this error &quot;free variable 'Keys' referenced before assignment in enclosing scope&quot;</p>
  <p>Thanks in advance!</p>