modifying keys in dictionaries

  • Thread starter Thread starter Paul F
  • Start date Start date
Paul said:
is there a way to modify a key of a dictionary at all?

No, if you would change the value of a key, the item would be in the
wrong bucket, and you would never find it again.

If you want to change the key of an item you have to remove the item
from the dictionary and add it with the new key.
 
Back
Top