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

Two graphs are shown below: graph A shows scatter points 1, 1 and 2, 2 and 3, 3 and 4, 4 and 5, 5graph A shows scatter points 1, 4 and 2, 4 and 3, 4 and 4, 4 an
The company database may be stored on a central database server and managed by a database adminstrator true or false
East Pakistan chose the name Bangladesh for its name as an independent country to acknowledge _____. A. the ethnic group that made up the majority of the popula
Help ASAP PLEASE!!! match the term with the appropriate definition.
Carolina _________ cansada porque paseó por el parque todo el día. está es estoy soy
19 hundred thousandths in scientific notation
In order for cells to function properly, the enzymes that they contain must also function properly. What can be inferred using the above information?
Jessica isn't invited to a super bowl party her coworkers are throwing because she's a woman. jessica is experiencing ____ from her coworkers. a.discrimination
What is the mass of a 720-mL sample of ClF3 at 735 torr and 43 °C?
Which factors have the greatest impact on regional oil production? Choose all that apply. MARPOL OPEC political conflict supply and demand