How to update values in a dictionary in Python?