# this doesn't work
invalid_dict = {[1, 5]: 'a', 5: 23}
# but this does
valid_dict = {(1, 5): 'a', 5: [23, 6]}
print(valid_dict)
I want to know what's the issue with invalid_dict that it doesn't work. I understand that a hash value is computed for each item in a dictionary for storing the key-value pair at that location in the memory. But it seems strange to me that hash value for the the tuple (1,5) can be computed but not for the list [1,5].