Is there any way to get a variable to act like a pointer in python? Heres a little code to describe the gist of what Im trying to do.
I know the correct way to go about this is to make it an object of a class but this is just a random example. Its not really exactly what Im doing. In what I am writing it doesnt make sense to make a class for just the one or two variables that Im trying to reference. This is something I've wished I had the ability to do quite a few times. It would be really nice. Any modules or anything that can help with this or tricks or anything?
Python:
name = 'Matt'
score = 0
player = {'name': name, 'score': score} # This is what I want to act as a pointer
# ******** FAKE GAME **********
score += 10 # 10 points added to score
print(player) # This will not print out the updated score
I know the correct way to go about this is to make it an object of a class but this is just a random example. Its not really exactly what Im doing. In what I am writing it doesnt make sense to make a class for just the one or two variables that Im trying to reference. This is something I've wished I had the ability to do quite a few times. It would be really nice. Any modules or anything that can help with this or tricks or anything?