Dictionary keys have to be immutable objects. Lists are mutable objects. Comvert all the lists to tuples.
bumsfeld
Nearly a Posting Virtuoso
1,445 posts since Jul 2005
Reputation Points: 404
Solved Threads: 184
Here is a possible way to create tuples from lists:
list1 = [1, 2, 3]
tuple1 = tuple(list1)
print list1 # [1, 2, 3]
print tuple1 # (1, 2, 3)
list2 = [[1, 2], [3, 4]]
tuple2 = tuple([tuple(sublist) for sublist in list2])
print list2 # [[1, 2], [3, 4]]
print tuple2 # ((1, 2), (3, 4))
bumsfeld
Nearly a Posting Virtuoso
1,445 posts since Jul 2005
Reputation Points: 404
Solved Threads: 184