Discuss / Python / 作业。。。不知道对不对

作业。。。不知道对不对

Topic source

>>> s1=(1,2,3)

>>> s2=(1,[2,3])

>>> d={s1,s2}

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

TypeError: unhashable type: 'list'

>>> t=set([s1,s2])

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

TypeError: unhashable type: 'list'


  • 1

Reply