How would I go about counting the words in a sentence? I\'m using Python.
For example, I might have the string:
string = \"I am having a very
You can use regex.findall():
import re line = " I am having a very nice day." count = len(re.findall(r'\w+', line)) print (count)