d[12] = 5 - ok, result of the operation is d = {12: 5}
d["1,2"] = 5 - ok, result of the operation is d = {'1,2': 5}
total result is d = {12: 5, '1,2': 5}
d[(1,2)] = 5 - ok, result of the operation is d = {(1,2): 5}
total result is d = {12: 5, '1,2': 5, (1,2): 5}
d[[1,2]] = 5 - error, list cannot be in the index of dictionary
Answer
d[[1,2]] = 5 generates an error
Comments
Leave a comment