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

Which country does the number 33 represent? A. Central African Republic B. Democratic Republic of Congo C. Congo D. Zambia
what factors do not affect the final speed of a roller coaster?
which is greater 2m or 275cm
The solar system is approximately _____ years old. a. 6000 c. 4.6 billion b. 280 million d. 15 billion Please select the best answer from the choices provide
Yoko purchased a prepaid card for $15. Long distance calls cost $.13 a minute using this card. Yoko used her card only to make a long distance call. If the rema
What is the water cycle apply to in life? A. Useless B. Need it to live C. We would die without D. Need it for all living organisms
Select all items that describe the Amish culture. 1 speak Creole or Spanish 2 wear simple clothing 3embrace technology 4 live in farming communities 5use h
how does the circulatory system help other systems function?
What was discovered in 1965 and is believed to be leftover thermal energy from the big bang? red shift the Eagle Nebula the Doppler effect background radia
What is the prime factorization of 882