LearnPy Hub
← Regular Expressions problems
Easy

Count a Whole Word

Read a line and count how many times the whole word the appears, in any case, using re.findall(r'\bthe\b', text, re.IGNORECASE).

Input

One line.

Output

One integer.

Sample 1

Input
The cat and the dog
Output
2

Sample 2

Input
there and then
Output
0
solution.py
Output appears here
Count a Whole Word · Python practice problem · LearnPy Hub