if a vowel is found, it takes the position where it is and the sum if the position is even or odd
def conteo_vocales(cadena: str)->int:
numero_vocales = 0
longitud = len(cadena)
i = 0
pares = 0
impares = 0
while i<longitud :
if cadena[i] == "a" or cadena[i] == "e"or cadena[i] == "i"or cadena[i] == "o"or cadena[i] == "u":
numero_vocales += 1
if i %2 == 0 :
pares +=1
else:
impares +=1
i += 1
if impares > pares:
rta = 1
elif pares < impares:
rta = 2
elif pares == impares:
rta = 0
return rta
h = conteo_vocales("hormigas")
print(h)
then the console bounces "local variable 'rta' referenced before assignment"