I am trying to retrieve the key of the value 1 if 1 exists in first column of a list. For example:
{1: [3, 2, 3, 2], 2: [1, 2, 3, 4], 3: [3, 4, 2, 1],}
We have 1 in located key 2 first column. How can I retrieve it? my brain froze in this step.
try this
print([k for k in d if d[k][0] == 1 ])
1.4m articles
1.4m replys
5 comments
57.0k users