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

A small plane flew 808 miles in 4 hours with the wind. Then on the return trip flying against the wind it travels only 488 miles in 4 hours. What were the wind
PLEASE ASAPPP 50 POINTS
Why is it important to have tight controls on liquor/beverage inventory?
Which characteristic of the cats shows a variation?
In data communication, convergence refers to integrating voice, video, and data so that multimedia information can be used for decision making. True or False
help me pls i have 10 minutes left
When Julio and Max to become the number one window-cleaning company in their city, they were engaging in the management function of
What does Friar Lawrence agree to do for Romeo? A. He agrees to stop the marriage between Juliet and Paris. B. He agrees to find Juliet and bring her back to Ro
Write 1-2 sentences explaining how speakers use their voice and language when giving a speech.
How long does it take for dental stitches to dissolve.