Count a Few Words X61892


Statement
 

pdf   zip   main.py

html

Given a tuple of strings, how many of them have exactly three times the letter ’o’? Write a function count3o(t) that receives a tuple t, made up of arbitrary strings, and returns the quantity of strings in the tuple that have exactly three occurrences of the lowercase vowel ’o’.

Observation

Solutions employing the method str.count() may be accepted but will not receive the maximum grade.

Sample session
>>> count3o( ('Oh! oh! oh!', 'Noooo!') )+1234
1234
>>> count3o( ('Hohoho', 'Oh! oh! oh!', 'good food', 'our Boolean value', 'How do we know?') )
3
Information
Author
José Luis Balcázar
Language
English
Official solutions
Python
User solutions
Python