Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 1
Can we change the keys of a dictionary?
4 Respostas
+ 7
SinceĀ keys areĀ whatĀ dictionariesĀ use to lookup values,Ā you can't reallyĀ changeĀ them. The closest thingĀ you can doĀ is to save the value associated with the oldĀ key, delete it, then add a new entry with the replacementĀ keyĀ and the saved value.
+ 2
No we can't change the keys of dictionary as they Are immutable
+ 1
Keys of dicts are immutable
+ 1
Code Crasher might be an accident or sth. else.
Not too serious