sydneyree1954 sydneyree1954
  • 04-07-2019
  • Computers and Technology
contestada

Write a function def countWords(stri ng) that returns a count of all words in the string string. Words are separated by spac For example, countWords ("Mary had a little lamb") should return 5.

Respuesta :

SerenaBochenek SerenaBochenek
  • 14-07-2019

Answer:

def w_count(s):

   return(len(s.split()))

st=input('Enter a string:')    

print("Number of words in given string=",w_count(st))

Explanation:

Ver imagen SerenaBochenek
Ver imagen SerenaBochenek
Answer Link

Otras preguntas

three substances that make up an atom
find in the following, x. SV || RU
What are some possible explanations you think a researcher might find to explain why the fish are washing up on the shore of Lake Superior
For calendar year 3, Clark Corp. had depreciation of $300,000 on its income statement. On its Year 3 tax return, Clark had depreciation of $500,000. Clark's inc
The term biocapacity refers to _______.the average number of children born per womanthe rate of human population growththe amount of productive land and sea ava
What is the next square number in the list? 49, 64, 81,
Find the product: (-3)(-5)
perry traveled at an average speed of 55 mi per hour for 3.5 hours and then traveled at an average speed of 60 miles per hour for 2.5 hours. what was the total
Which of the following solutions would you expect not to conduct electricity?
the area of a rectangular park is 82,520 square feet. the length of the park is 350 feet. which equation can u use to find w,the width of the garden in feet? 35