abc = {}
abc[int: anotherint]
Then the error came up. TypeError: unhashable type? Why I received this? I've tried str()
abc = {}
abc[int: anotherint]
Then the error came up. TypeError: unhashable type? Why I received this? I've tried str()
This seems to be a syntax issue:
>>> abc = {}
>>> abc[1] = 2
>>> abc
{1: 2}
>>> abc = {1:2, 3:4}
>>> abc
{1: 2, 3: 4}
>>>
At least the syntax of following is incorrect
abc[int: anotherint]
I guess you want to say
abc = [int: anotherint]
Which is incorrect too. The correct way is
abc = {int: anotherint}
unless abc
is already defined in which case:
abc[int] = anotherint
is also a valid option.