python - Searching for a partial match in a list of tuples -


if have list of tuples:

[(0,1),(1,2),(5,5),(4,1)] 

how can find items partially match search term?

eg, in above example, (_, 1) should match (0, 1) , (4, 1).

new_list = [i in old_list if i[1] == 1] 

Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -