Are keys of a dictionary in python immutable? Can we change the keys??If yes, then How?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Are keys of a dictionary in python immutable? Can we change the keys??If yes, then How??

7th Jan 2021, 5:56 PM
Sourya Banerjee
Sourya Banerjee - avatar
3 Answers
+ 4
Sourya Banerjee Key can't be modify. You can just remove or add new key. Values can be modify.
7th Jan 2021, 6:12 PM
A͢J
A͢J - avatar
+ 3
Yes, I think they are. But you can remove a key and then add a new one.
7th Jan 2021, 6:06 PM
Lisa
Lisa - avatar