Untitled
unknown
python
a year ago
321 B
4
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