Assume that d has been initialized as an empty dictionary:
d = {}
Which of the following generates an error?
d[[1,2]] = 5
d[(1,2)] = 5
d["1,2"] = 5
d[12] = 5
1
Expert's answer
2018-08-30T03:53:46-0400
Answer is d[[1,2]] = 5 Because dictionary uses values of unchangeable types as keys. Strings, ints and tuples are unchangeable, lists are not.
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment