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

Data Analysis 7th grade math Laura kept a record of the number of minutes she spent at the gym this week. Day Minutes Monday 60 Tuesday 70 Wednesday 62 Thursda
What is one reason that the Tokugawa Shogunate promoted a policy of isolationism in Japan? A. They feared an invasion because their army was weak. B. They t
I NEEED HELLPPP write this using exponents question
During the design of spherical pressure vessel for space programs, a primary criterion is the mass of the vessel (which determines how much it costs to put it i
Question Number 4) A tool The Weather Channel uses to tell them what are the key elements of the role and what is the compensation for the role is a(n) ________
Convert to vertex form: f(x) = x2 + 16x + 64
Using the digits 2, 4, and 6, write a number with a 4 in the hundred thousands place and a 2 in the hundreds place.
Why dont we see stars when astronaut are on the moon
When using the four-step process for organizing creative thinking, which step involves ideas beginning to flow?
Under which set of conditions do real gases deviate the most from the ideal gas law?