slides06-ex5.py
File contents
s = raw_input("Digite a frase: ") cont = 0 pos = 0 while pos != -1: pos = s.find("ado", pos) if pos != -1: cont += 1 pos += 3 #proxima posicao inicial da nova busca #outra forma: cont = s.count("ado") print "Existem %d 'ado' na frase"%cont