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

What is 6÷11(Point giveaway):)​
Find the area of this whole trapezoid
-a + 28 = 14 solve for a
Hilton Company manufactures two products: Product A100 and Product X500. The company currently uses a plantwide overhead rate based on direct labor-hours. The H
The area of a rectangle is 21.54 square feet. If the width is 6 feet, what is the length and what is the perimeter?
what is the value of 5(a + b) when a=1 and b=6 ​
can someone follow my tt its c1ndy.dont.miss
If I animated 4 frames in 6 minutes how many frames will I animate in 12? (Will give branliest for whoever explains it the best!)
What literary device is Esperanza using in the following passage:” The kids...dangle upside down from knees and almost break like fancy museum vases you can't r
The ORA is a: A. Personality assessment. B. SAT preparation tool. C. College Scholarship. D. PSAT preparation tool.