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

Graph the equation. y=- 1/7( x - 7)(x+7)
Please help me with this! It’s not timed so take your time!
What do strong expository, descriptive, and persuasive essays all have in common?
At 6:00 A.M., there were 800,000 gallons of water remaining in a reservoir. After 8 hours of irrigation, there were 100,000 gallons of water remaining. Write a
Jane had $60. She spent an average of $5 each day. How many days didshe take to spend all her money?=She tookdays to spend all her money.&​
Please Help! I need good Anime to watch!
Select true or false for each statement
______Which layer contains the most organic material? A. A horizon B.B horizon C.C horizon D. The bedrock
The bus service has a network that covers cities in the United States. It is the largest provider of intercity bus transportation.
A swimming pool is open for 12{3}{4} hours each day. The lifeguards work shifts that are {3}{4} hour long. How many shifts are there each day?