I have two list.
red = [[2,2], [2, 3], [2, 4], [3, 2], [3, 3], [3, 4], [4, 2], [4, 3], [4, 4]]
blue = [[3, 3], [3, 4], [3, 5], [3, 6], [4, 3], [4, 4], [4, 5], [4, 6], [5, 3], [5, 4], [5, 5], [5, 6], [6, 3], [6, 4], [6, 5], [6, 6]]
how to find intersection in this case?
I know what is the set.
but, In this case... I think it can not to do to use list.
list in list... how can i do?
[[2, 2], [2, 3], [2, 4], [3, 2], [3, 3], [3, 4], [4, 2], [4, 3], [4, 4]]
[[3, 3], [3, 4], [3, 5], [3, 6], [4, 3], [4, 4], [4, 5], [4, 6], [5, 3], [5, 4], [5, 5], [5, 6], [6, 3], [6, 4], [6, 5], [6, 6]]
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-46-e0a8e962ef62> in <module>()
11 print(list(red))
12 print(list(blue))
---> 13 intersection = len(list(set(red) & set(blue)))
14 print(list(set(red) & set(blue)))
15 print(set(list(red)) & set(list(blue)))
TypeError: unhashable type: 'list'