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

Why were the greeks able to defeat the persians on the plain of marathon?
Q.3. Does the poet enjoy teaching? Justify your answer.
PleAse help and show how you got it if you don’t mind
What are the laws of physics?
Jody is cutting wood to make picture frames. How many pieces of wood that are 10 3/4 inches long can cut from a board that is 75 1/4 inches long? A) 7 pieces B)
Which enlightenment thinker can be accredited with the constitutional principle of separation of powers?
How can hypnotherapy help people with cancer? NEED HELP!!!!
Research shows that when people drop out of sports, they are unlikely to ever play sports again.
The walls of the tombs inside the pyramids were painted with a. pictures of the deceased b. his family c. a list of his accomplishments d. all of the above
ALGUIEN CONOCE A KRONO ZOMBER