aboutsummaryrefslogtreecommitdiff
path: root/challenge-331/eric-cheung/python/ch-1.py
blob: a7d0dcd351a029210667002ab3ebca484771483b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import re

## strInput = "The Weekly Challenge"  ## Example 1
## strInput = "   Hello   World    "  ## Example 2
strInput = "Let's begin the fun"  ## Example 3

strOutput = re.sub(r"\s+", " ", strInput).strip()

arrOutput = [strLoop for strLoop in strOutput.split(" ") if strLoop]

print (len(arrOutput[-1]))