dict
keys must be unique. If you reassign a key, the dictionary just deletes the existing entry before adding the new value.
>>> A = {'color':'right'}
>>> A
{'color': 'right'}
>>> A['color'] = 'wrong'
>>> A
{'color': 'wrong'}
That's what happened in your case
A={'color':'right','color':'wrong'}
The 'color', 'right'
key/value pair was set but it was deleted when the like keyed 'color', 'wrong'
pair was set afterwords. The same thing happens if you use the dict
constructor
>>> A = dict([('color', 'right'), ('color', 'wrong')])
>>> A
{'color': 'wrong'}