Jan-07-2022, 06:08 AM
A dictionary is a set of key/value pairs. You have to tell the dictionary which key you are trying to update. Your program just shoves a new value at it.
But assuming
If the key has digits in it, do you want to change the key, or do you just want to change the values?
But assuming
cybc
is your dictionary, then str(cybc)
is just a big string of all the keys and values (and some punctuation) smushed together. So when you're handed a string, you can't tell what part of the dictionary it came from.If the key has digits in it, do you want to change the key, or do you just want to change the values?