TypeError : Unhashable type

前端 未结 6 687
灰色年华
灰色年华 2020-11-29 05:45

I am trying to get a list of list of tuples : something like [ [(1,0),(2,0),(3,0)],[(1,1),(2,1),(3,1)....]] I used this statement

set([(a,b)for         


        
6条回答
  •  爱一瞬间的悲伤
    2020-11-29 06:21

    A list is unhashable because its contents can change over its lifetime. You can update an item contained in the list at any time.

    A list doesn't use a hash for indexing, so it isn't restricted to hashable items.

提交回复
热议问题