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

the sedimentary rock formed when water deposits tiny particles of clay in very thin, flat layers is called what?
How to say Maze and Runner in Spanish?
72 ounces in 6 steaks unit rate
at 7:30 am, a bus left town P for town Q at a speed of 60 kilometers per hour. 15 minutes later, a car left town ! and headed for town P. The car reached town
The Alternative for the Americas agreement of the early 2000s is primarily aimed at A. excluding the United States from Latin America. B. creating a Latin Ame
In The Communist Manifesto, Karl Marx hypothesized that capitalism would fail if workers _________________
How would the Philippine government respond to an insurgency?
Weightlessness is experienced by an astronaut in space. This means that the astronaut's muscles have to be stronger to move his body or lift other objects. True
Explain how we view stars magnitude in the night sky and how that is different from the way astrologists study stars. plz awnser
WHAT IS 9.1/3576, SHOWING STEPS