I have a problem with keys in a dict in python.I have a list of lists:
x=[['A','B','C','D'],['A','B','E','F'],['A','B','G','H']]
This is my code:
{(tuple(t[:2])):t[2:] for t in x}
And this is my output:
{('A', 'B'): ['G', 'H']}
The code takes only the last key / value, because there are identical keys.
The output should be:
{('A', 'B'):[['C','D']['E','F'],['G','H']]}
I can't import libraries.