python中无法被转化为set的list[list组成的list]

arr = [[a],[b]]

set(arr)

output:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'list'

 

arr =[1,2]

set(arr)

output:

set([1,2])

posted @ 2018-10-10 22:04  夜歌乘年少  阅读(1751)  评论(0编辑  收藏  举报