Untitled
unknown
python
10 months ago
321 B
2
Indexable
def policz_oko(tekst): licz = 0 for i in range(2, len(tekst)): if tekst[i] == 'o' and tekst[i-1] == 'k' and tekst[i-2] == 'o': licz += 1 # zwiększamy o 1 return licz if __name__ == '__main__': s = input('Podaj zdanie: ') wynik = policz_oko(s) print(wynik)
Editor is loading...
Leave a Comment