1
My doubt is the following, in this excerpt of code I am removing a character that specifies with the replace()
:
lista = [["de carlos,"],["des.dd carlossd,"],["Peixe, texto!"]]
lista_separados = ['.',',',':','"','?','!',';']
for i, j in enumerate(lista):
lista[i] = j[0].replace(',','').replace('!','').replace('.','')
print (lista)
exit:
['de carlos', 'des dd carlossd', 'Peixe texto']
in this example I was able to delete the specified characters, but
someone has some idea of accomplishing this in another way?
I have a list of lists, because each sub-list refers to a content file[i]. txt from the base documents with various.txt files, got it? nice this way you explained! did not know...
– William Henrique
@Williamhenrique in this case the first alternative is the appropriate one. Welcome, I’m glad I helped
– Miguel