Keys() and Vakues() need help


<my_dict.keys = {
"Name" : "Smith",
"Age" : 51,
"DBFL" : True

print my_dict.keys()
print my_dict.

here is the error message
Traceback (most recent call last):
File "python", line 4, in
AttributeError: 'dict' object attribute 'keys' is read-only


An important realisation when writing code is that guessing isn't good enough, instead we have to find out. It seems to me like you guessed how to do something, and also did not try to find out. Consider what action you want to carry out, and then describe that in a couple of words to your favourite search engine along with the word 'python' for context. If that doesn't turn out any results, then describe to us what you're trying to do - right now you leave us guessing, which is difficult to work with, we can find out by asking you.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.