LearnPy Hub
← Regular Expressions problems
Easy

Count Words with Regex

Count the words in a line, where a word is a run of letters (use [A-Za-z]+).

Input

One line.

Output

A count.

Sample 1

Input
Hello, world! It's 2026.
Output
4

Sample 2

Input
123
Output
0
solution.py
Output appears here
Count Words with Regex · Python practice problem · LearnPy Hub