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 are authoritarian and totalitarian systems considered unlimited governments
which wife of a founding father pleaded that he and his colleagues consider the rights of women when creating the new government? a. sarah franklin b. dolly mad
After submitting a résumé by mail, how long should you wait before following up with an employer?a. 1 dayb. 2-3 daysc. 1 weekd. 2 weeks
21. The area of a circle is 240cm2. If 40cm2 was shaded what fraction of it was not?
Mr reinard bought 5 pounds of feed for his chickens for $10. how much did the feed cost per pound in dollars
How can a microscopic paramecium and a large giraffe both be described by cell theory? How are they different?
Which text synopsis is most likely a narrative? A. A poet's twelfth sonnet, written on the topic of his lover's hair B. A practical guide to helping your
What's the right way for this sentence"after being baked in the oven for thirty minutes, her guests were given the cookies"
Which of the following sentences contains a helping verb?
What were Egypt's greatest accomplishments?