P=[' s', 'w', 'q',......, 'a']
K={}
CodePudding user response:
Theoretical and logic doesn't work, 'T' is equivalent to the number of pages of the dictionary, k={' T ': [' s',' w ', 'q',......, 'a']} said the 'T' in the page s, w, q, aK={' T ':' s, 'T', 'w', 'T' : 'q',... Said, 'T' : 'a'} what do you mean??????? K all pages of the dictionary is called the 'T' page? It from the dictionary if you want to get the 'T' page value, he is to return, s or w??
CodePudding user response:
Really want to give T, then define multiple dictionaries, k1={' T ':' s'}, k2={' T ', 'w'}...CodePudding user response:
The dictionary keys are not repeatable, so there can be only one dictionary K which the 'T' key, if there is repeated, the value behind the will overwrite the previous,Can put them in a kind of data matching
P=[' s', 'w', 'q', 'a']
> K=[(' T ', I) for I p] in
> K
[(' T ', 's'), (' T ', 'w'), (' T ', 'q'), (' T ', 'a')]
CodePudding user response:
To correct the above:P=[' s', 'w', 'q', 'a']
> I} [{k='T' : for I p] in
> K
[{' T ':' s'}, {' T ', 'w'}, {' T ':' q '}, {' T ':' a '}]