0

I'm facing an issue that seems easy to resolve but I can't find a simple solution to it:

I want to create a few empty lists that will later copy each other inside my main function, but when I when I try to do so I run into this error:

UnboundLocalError: local variable 'Player4' referenced before assignment

Player1 = []
Player2 = []
Player3 = []
Player4 = []
Player5 = []
Player0 = []

def getinfo ():

        Atest = [1,2,3,4,5,6,7]
        Player0 = Player5
        Player5 = Player4
        Player4 = Player3
        Player3 = Player2
        Player2= Player1
        Player1= Atest

getinfo()

at first I need all the list to be empty and then pass information to the other lists but it seems like to isn't the right way to proceed...

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
fatsifat
  • 21
  • 2

0 Answers0