is that I want to count the repetitions that the word ANA has in the word BANANA. When using count, it only counts me 1, but it's two, any advice?
Explanation of code and problem: This is my code, where what I do is identify the vowels and thus be able to start all the substrings with those vowels that I extract. Then, I count the occurrences of those substrings with count and so that they don't repeat themselves, I put them in a list called formedwords_j2. Among those, the ANA substring comes out and with count it only counts 1 occurrence, but in BANANA it is repeated twice as you can see.
posicion=0
for letra in string:
if es_vocal(letra):
if not letra in vocales:
vocales.append([letra, posicion])
posicion+=1
for vocal in vocales:
palabra_j2=""
nueva_string=string[vocal[1]:]
for letra in nueva_string:
palabra_j2=palabra_j2+letra
if not palabra_j2 in palabrasFormadas_j2:
palabrasFormadas_j2.append(palabra_j2)
puntos=string.count(palabra_j2)
score_j2+=puntos