Because your l1 is shorter than l2, and you want l1 to be the key of the dictionary, and l2 to be the value of the dictionary, this will cause a problem: fewer keys correspond to more Values are used to form a dictionary, which will inevitably result in the keys in l1 needing to be reused, but this conflicts with the non-repeatable keys of the dictionary, because two “a” keys are not allowed in a dictionary. Of course, if it is the other way around, with l2 as the key and l1 as the value, this problem does not exist, for example, it forms:
{1:'a', 2:'b', 3:'c', 4:'a', 5:'b', 6:'c'}
is absolutely no problem. To achieve this, you can write:
is actually impossible to construct. The dictionary key-value pair needs to be uniquely corresponding. End
Because your
l1
is shorter thanl2
, and you wantl1
to be the key of the dictionary, andl2
to be the value of the dictionary, this will cause a problem: fewer keys correspond to more Values are used to form a dictionary, which will inevitably result in the keys inl1
needing to be reused, but this conflicts with the non-repeatable keys of the dictionary, because two“a”
keys are not allowed in a dictionary.Of course, if it is the other way around, with
l2
as the key andl1
as the value, this problem does not exist, for example, it forms:is absolutely no problem. To achieve this, you can write:
Run result: