Updating dictionary in python