I've been trying to solve this problem for hours in my discord bot, and have found something that makes me even more confused, can anyone tell me if I'm doing anything wrong? Data is a dictionary loaded from a data file, that contains keys of user id's, and the value of those user id's are dictionaries with info about the user. e.g. It doesn't seem like the dictionary is being updated...
data = {
528904852321: {'pocket_money': 1000},
085984902543: {'pocket_money': 1000},
}
print(data[robberid]['pocket_money']) # 1000
print(data[victimid]['pocket_money']) # 1000
amount = 50
print(amount) # 50
data[robberid]['pocket_money'] -= amount
data[victimid]['pocket_money'] += amount
print(data[robberid]['pocket_money']) # 1000
print(data[victimid]['pocket_money']) # 1000