Untitled
Anonymous
python
06/03/2024 5:00 AM
428 B
17
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