iterate through dictionary and update values python