Question: (Python problem) Write a method def countWords(string) that returns a count of all words in the string str. Words are separated by spaces. For example,
(Python problem)
Write a method
def countWords(string)
that returns a count of all words in the string str. Words are separated by spaces. For example, countWords("Mary had a little lamb") should return 5.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
