fork(2) download
  1. lista = [['julian', '0', '4'], ['ana', '10', '4']]
  2.  
  3. def search (lista, valor):
  4. return [(lista.index(x), x.index(valor)) for x in lista if valor in x]
  5.  
  6. print(search(lista, "julian")) # [(0, 0)]
  7. print(search(lista, "ana")) # [(1, 0)]
  8. print(search(lista, "0")) # [(0, 1)]
  9. print(search(lista, "4")) # [(0, 2), (1, 2)]
  10. print(search(lista, "foo")) # []
Success #stdin #stdout 0.02s 28384KB
stdin
Standard input is empty
stdout
[(0, 0)]
[(1, 0)]
[(0, 1)]
[(0, 2), (1, 2)]
[]