I'd like to know the logic of for i in vogais
, as in the example.
Doubt, does it load the entire typed word into a list in memory and already sorts according to our rankings, or does it read character by character?
For example, if you type " alguma coisa aqui
", using debug Pycharm, it already knows the amount of a
, for example.
def contaVogais(caracteres):
caracteres = caracteres.upper()
result = 0
vogais = 'AEIOU'
for i in vogais:
result += caracteres.count(i)
return result