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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top