My question is the following, in this code snippet I'm removing a character that I specify with 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)
output:
['de carlos', 'des dd carlossd', 'Peixe texto']
In this example I was able to delete the specified characters, but
Does anyone have any idea how to accomplish this in another way?