How to check the entry of a key in the dictionary value? Any length of the dictionary When I punched my key was checked in all the values of the dictionary. Example
>>> print(dic) {1: [1, 5], 2: [1, 2], 3: [3, 4], 4: [3, 4], 5: [1, 5]} >>> for items in dic.keys(): for i in dic.values(): print(items, i) 1 [1, 5], 1 [1, 2], 1 [3, 4], 1 [3, 4], 1 [1, 5], 2 [1, 5], 2 [1, 2], 2 [3, 4], 2 [3, 4], 2 [1, 5] Next with 3, 4, and 5 is the same thing. I need only a verification key -> key value, not a key -> KEY value
I am interested in the output of the key and the values in which this key is included. for the unit should output 1 [1, 5], 1 [1, 2] .