SyntaxFix
Write A Post
Hire A Developer
Questions
You can use regex.findall():
regex.findall()
import re line = " I am having a very nice day." count = len(re.findall(r'\w+', line)) print (count)