I would like to get the dictionary a using the dictionary b but it gives me an error.
My code :
a = {"c":"d"}
b = {{"a":"b"}:a}
print(b[{"a":"b"}])
My error :
File main.py in line 2
print(b[{"a":"b"}])
TypeError: unhashable type: 'dict'
I would like to get the dictionary a using the dictionary b but it gives me an error.
My code :
a = {"c":"d"}
b = {{"a":"b"}:a}
print(b[{"a":"b"}])
My error :
File main.py in line 2
print(b[{"a":"b"}])
TypeError: unhashable type: 'dict'
You cannot use other dictionary as a key, u can only store a dictionary as a value!
example:
a = {
"key": {"key":"value"}
}