Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

count words python

str = "Programming is fun"

# Use split to decompose str into words
# delimiters are assumed to be white space characters
words = str.split()

print("Words count:", len(words))  # Words count: 3
 
PREVIOUS NEXT
Tagged: #count #words #python
ADD COMMENT
Topic
Name
9+2 =