I have a function that receives 3 lists:

doc1:

```
[['ser', 'VSIS3S0', 1], ['francisco_villa', 'NP00000', 2], ['norte', 'NCMS000', 1], ['revolucion_mexicana', 'NP00000', 1], ['nombrar', 'VMP00SM', 1], ['centauro', 'NCMS000', 1]]

```

doc2:

```
[['pintor', 'NCMS000', 1], ['ser', 'VSIS3S0', 1], ['muralista', 'AQ0CS0', 1], ['diego_rivera', 'NP00000', 1], ['frida_kahlo', 'NP00000', 1], ['caso', 'NCMS000', 1]]

```

consulta:

```
[['ser', 'VSIP3S0', 1], ['francisco_villa', 'NP00000', 1], ['quien', 'NP00000', 1]]

```

function:

```
def vectores(doc1,doc2,consulta):
res=[]
l1=[]
cont = 0
r = doc1 + doc2 + consulta
for i in r:
    l1.append(i[0])
for e in doc1:
    if e[0] in l1:
        res.append(e[2])
    else:
        res.append(e[0]==0 * len(l1))
return res

[1, 2, 1, 1, 1, 1] -> res

```

I need to compare if the key[0] of doc1 exists in key[0] of l1, if so append key[2] to the res list, **and if they don't match append zeros to the res list building a vector with lenght l1**

I'd like to get an output like this:`[1, 2, 1, 1, 1, 1, 0, 0, 0, ...]`

-The elements of the output vector are the key[2] value of the lists.
-The zeros would be that the words of doc1 are not in l1.
- Once I have the desire output I´d like also to repeat the same procedure with doc2 and consulta.

Thank you in advance! ;)