I need to make a dictionary where you can reference [[1,2],[3,4]] –> ([1,2]:0, [2,3]:0)
I’ve tried different ways but I can’t use a list in a dictionary. So i tried using tuples, but its still the same. Any help is appreciated!
I need to make a dictionary where you can reference [[1,2],[3,4]] –> ([1,2]:0, [2,3]:0)
Share
You need to use tuples:
or (for python2.7+)
Edit:
Reading the comments, OP probably want to count occurrences of a list: