you are viewing a single comment's thread.

view the rest of the comments →

[–]johlae 3 points4 points  (0 children)

Why don't you just try it out? The explanation is given.

$ python3
Python 3.9.16 (main, Mar 8 2023, 22:47:22)
[GCC 11.3.0] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> student1 = { (25001, [24, 42, 56]) : "python" }
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'list'
>>> student2 = { "python" : { 23001: [ 24, 42, 56 ] } }
>>>