title: Python 3 - UnboundLocalError problems
body: <pre><code>import random
  points1=0
  points2=0
  bank1=0
  bank2=0
  def gameloop():
      cont = "Keep going"
      while cont=="Keep going":
          roll1=random.randint(1,6)
          roll2=random.randint(1,6)
          if roll1+roll2==2:
              bank1=0
              points1=0
              print("Unlucky! You've lost your banked and running total! Now it's the next player's turn.")
          else:
              points1=points1+roll1+roll2 
  #This is the first place I keep getting the problem.
  </code></pre>
  
  <p>So, I tried to shorten my code as much as possible so that it included all the necessary parts. This is as far as I think I can format it to make sense. Also, I can't remove the "def gameloop():" because I need it later. The problem here is, I keep getting UnboundLocalError and I've tried looking into it but I don't know exactly how to apply the solutions. Any help would be greatly appreciated - so thanks in advance!</p>