How would I remove dictionary items that have different keys but identical values? I am sure there a better way than my novice algorithm...?

**Example:** (abends with error "*dictionary changed size during iteration*")

*The goal of this example is to remove either 'car\_id' or 'truck\_id' from dict.*

```
key_fields_obj = {}
key_fields_obj['car_id'] = 'bob'
key_fields_obj['bike_id'] = 'sam'
key_fields_obj['truck_id'] = 'bob' #goal: remove this one, so left with only car_id and bike_id

for item in key_fields_obj:
    tst = key_fields_obj[item]
    for comp in key_fields_obj:
        if item == comp:
            continue
        cmp = key_fields_obj[comp]
        if cmp == tst:
            del key_fields_obj[comp]

print(key_fields_obj)

```