Q:

Python - Updating Variable in For Loop

So I decided to write Monopoly in Python, but I'm having some trouble updating the players location. I wrote  a for loop that iterates through the players, rolls the dice for each one, and then updates their location. The problem is that the location variable isn't keeping the latest location, it keeps resetting back to 0 at the start of the for loop. Here's my code:
player1location = 0

def turn(numberPlayers, player, player1location, Board):
    for player in range(numberPlayers):
        player = 'Player'+str(player+1)
        print 'It\'s', player, 'turn!'
        print player1location
        rollDice = raw_input('Press Enter to roll the dice!')
        diceRoll = random.randint(1,6)
        print player, 'rolled a', diceRoll
        player1location = player1location + diceRoll
        print 'You landed on', player1location
        print '\n'

while True:
    turn(numberPlayers, player, player1location, Board)

I can provide more of the code if necessary, but I think this is everything that controls the players location. Thanks!
EDIT: So apparently I'm changing the local variable instead of the global variable. How would I change the global variable instead?

A:

You have function parameter with the same name as your target variable which you want to update. 
Due to which, any changes you make is made to the function parameter, and not to the global variable. That's because the function creates a local scope for the paremeter you are passing to the function. So, it overshadows the variable defined with the same name globally.
So, either change the name of the function parameter player1location or the name of the global variable.

