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

How many instances of cell-cell communication are involved in the motor component of a visceral reflex arc?.
Can I have the solution with steps
Larry likes skeet shooting. a clay disc is shot into the air and the participant tries to shoot it. he rarely misses, because he knows that the flight of the di
Find the distance between the parallel lines y=x-5 and y=x+6
Find all real numbers $a$ that satisfy \[\frac{1}{a^3 + 7} -7 = \frac{-a^3}{a^3 + 7}.\]
Which is a density-independent limiting factor? 1. Space 2. Food 3. Earthquake 4. Diseases
Can you explain the English spelling rules?​
rred pozed nt afts w meeting na meeting 6. Read this paragraph: (1) Around the nation, incidents of cyberbullying have risen dramatically. (2) Our school is not
Which two protests evolved from symbolic relationships of organism which resulted in eukaryotic organisms chloroplast
what's an example of radical technological change