Posts by PipocaInsuflada • 5 points
3 posts
-
-4
votes1
answer52
viewsQ: Remove duplicates in tuple stems
The following code gives error when running def sensas(lst): lst_unica = [i for n, i in enumerate(lst_com_unicos) if i not in lst_com_unicos[n + 1:]] for lst_resulta_unica in lst_unica: return…
-
0
votes1
answer73
viewsQ: remove duplicates by prespetiva of tuples
I have this code working, yet I wanted to do it from the perspective of the tuples. Can assist? def remove_repetidos(lst): lista = [] #lista vazia for i in lst: if i not in lista: lista.append(i)…
-
-1
votes1
answer79
viewsQ: Get from a list all indices whose element is equal to a certain value
This is my code: def procuras(lista,valor): dicionario = {} for valor in lista: if valor in dicionario: dicionario[valor] = [i for i, item in enumerate(lista) if item == valor] else:…
pythonasked PipocaInsuflada 5