0
I created a list using a text file and I need to remove all words that are less than 3 characters and more than 8.
I’m having doubts about how to go through the list and create another list without the words that don’t meet the established criteria
This is what I’ve done so far:
`if __name__ == '__main__':
with open('senhas.txt') as senha: # ABRE O ARQUVO DE TEXTO COM AS PALAVRAS
words = [] # CRIA UMA NOVA LISTA PARA ARMAZENAR AS PALAVRAS
for n in senha: # ESTRUTURA DE REPETIÇÃO PARA ADICIONAR AS PALAVRAS NA LISTA NOVA
words.append(n.strip()) # RETIRA OS ESPAÇOS EM BRANCO
','.join(words) # SEPARA AS PALAVRAS EM APENAS UMA LINHA.
for i in range(len(words)):
words[i] = words[i].lower() # CONVERTE AS PALAVRAS EM MÍNUSCULO'
and the words with the file are here: https://pastebin.com/FY3UxZtK