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

An automobile light has a 1.0-a current when it is connected to a 12-v battery. determine the resistance of the light.
The study of how genes determine our nutritional requirements is called
complete the solution of the equation. find the value of y when x equals 0. -8x+8y=-16
Which term best describes the function of blood when considering the presence of carbon dioxide and endocrine hormones?
what is the simplified form of the expression 15y-4(2y+6)a.7y+24b.7y-24c.23y-24d.23y+24
describe the outcomes of political revolution in europe and latin america
In an e-mail message, what do the initials bcc mean? a. blind carbon copy b. british compiled corrections c. broken channel connection d. business configura
16% of what equals 44?
Which of the following powerful empires purposely isolated itself by avoiding global trade early in its history? A. The Ottoman Empire B. The Safavid E
Identify which of the following is not a step in the research process. a. find and retrieve materials b. choose and refine your topic c. cite your sources d