python基础中遇到的问题(TypeError: unhashable type: 'list')

day20200616

不能向集合中添加列表,字典,集合,会报(TypeError: unhashable type: 'list')错误。

可以添加元组。

s01 = set()
s01.add([1,2,3])
print(s01)

TypeError: unhashable type: 'list'
原文地址:https://www.cnblogs.com/hhds/p/13140913.html