A
A
Avrong2015-12-22 18:53:17
Python
Avrong, 2015-12-22 18:53:17

How to organize a search in a tuple of lists of two elements by the first element?

Available:
a =
Find:
Element with number 856.
How to organize the search?
... As an option - to sort into a dictionary, but with large volumes it will be impractical.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Kitaev, 2015-12-22
@Avrong

But it's better like this:
filter(lambda x: x[0] == '856', a)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question