Search for values from a list within a list of lists

0

I'm trying to find the elements of str2 in str1. Basically, if b and c is in item [1] of str1 but what I'm getting is:

>>> nueva
[['a1', 'b1', 'c1'], ['a1', 'b1', 'c1']]

when you should get:

>>> nueva
[['a1', 'b1', 'c1']]

str1 = [['a1','b1','c1']]
str2 = ['b','c']

nueva = []

for itema in str2:
    for item in str1:
        itema.find(item[1])
        nueva.append(item)
    
asked by Martin Bouhier 01.06.2018 в 17:48
source

0 answers