>>> d = {'a':1,'b':(1,2,3)} >>> d['b'] (1, 2, 3) >>> d = {'a':1,(1,2,3):2} >>> d[(1,2,3)] 2 >>> s = set([1,2,(1,2,3)]) >>> s {1, 2, (1, 2, 3)} >>> d = {'a':1,'b':(1,[2,3])} >>> d['b'] (1, [2, 3]) >>> d = {'a':1,(1,[2,3]):2} Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unhashable type: 'list' >>> s = set([1,2,(1,[2,3])]) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unhashable type: 'list'
Sign in to make a reply
TN