title | description | author | tags |
---|---|---|---|
Count Words |
Counts the number of words in a string. |
axorax |
string,word-count |
def count_words(s):
return len(s.split())
# Usage:
count_words('The quick brown fox') # Returns: 4
title | description | author | tags |
---|---|---|---|
Count Words |
Counts the number of words in a string. |
axorax |
string,word-count |
def count_words(s):
return len(s.split())
# Usage:
count_words('The quick brown fox') # Returns: 4