I have a filter to find the index of a stripe inside another list (I found in the group author Anderson Carlos)
fila = [['vitor','5'], ['vitor', '4']]
def sdb(filadb,nome,elemento):
if not (filadb):
return None
else:
filadb_l = filadb[0]
p = [(filadb_l.index(x), x.index(nome)) for x in filadb_l if nome in x] # linha 0 posicao 1
if p == []:
return None
else:
p_e = [(fila_pe.index(x), x.index(elemento)) for x in fila_pe if elemento in x] # linha 0 posicao 1
p_linha = filadb_l[p[0][0]]
posicao_e = fila_pe[p_e[0][0]][1]
p_elemento = p_linha[posicao_e]
result = [p_linha]
return p_elemento
function return:
[5] That way I have only one element.
I wanted to get back the 2 elements. return:
['5', '4']