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

Select the pronoun that correctly completes the sentence. In a jubilant tone, Salvador told Victor and _____ that he needed us to come over right away. (Points
If a bar of copper is brought near a magnet, the copper bar will be A. unaffected by the magnet. B. attracted by the magnet. C. made into an induced magnet.
5{-3.4k-7} + {3k+21}
A depression in the ground due to a cave collapse or acidic water dissolution of limestone is called a A. cave. B. stalactite. C. sinkhole. D. stalagmite.
What is jurisdiction? a. authority to hear the case c. the appointment of federal judges b. authority to discuss the need for laws in congress d. change how hea
what are the prime factors of 700
Which one of these is a unicellular organism? a. goldfish b. a seaweed c. an amoeba d. a tree
How do you Write 0.0034 as a percent
The Köppen classification system is used as a classification system for A. weather systems. B. high-pressure systems. C. climates. D. low-pressure systems.
2 equivalent fractions for 9/15