I assigned the player variable to 'x' and defined a function that swaps its values. Why does it still print 'x'?
def update_player(player):
if player == 'x':
return 'y'
else:
return 'x'
current_player = 'x'
update_player(current_player)
print(current_player)
Edit: I simply needed to assign the return value of the function to the player in order to update it.