dict
keys are immutable. That means that they cannot be changed. You can read more from the docs
dictionaries are indexed by keys, which can be any immutable type
Here is a workaround using dict.pop
>>> d = {1:'a',2:'b'}
>>> d[3] = d.pop(1)
>>> d
{2: 'b', 3: 'a'}