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

python - Installing PyDev in eclipse is failed -

PHP OOP-based login system -

c# - Nested Internal Class with Readonly Hashtable throws Null ref exception.. on assignment -