You created the following dictionary relationships = {'Jimmy':'brother'}. You then executed the following code, and received a KeyError exception. What is the reason for the exception?
Relationships['jimmy']
A) String comparisons are case sensitive so 'jimmy' does not equal 'Jimmy'.
B) You used the wrong syntax for creating the dictionary.
C) You should have used the code relationships['brother'].
D) There is a bug in Python.
Correct Answer:
Verified
Q1: You would typically use a for loop
Q2: In order to avoid KeyError exceptions, you
Q4: Sets are immutable.
Q4: Which function would you use to get
Q7: What is the value of the variable
Q8: Which statement would you use to delete
Q9: Which method would you use to returns
Q10: What method can be used to add
Q11: What would be the result of the
Q15: In a dictionary,you use a(n)_ to locate
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents