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

In linear programming a solution that does not simultaneously satisfy all constraints is called an
The mantle and core would be considered part of which earth system realm
what is the levels of organization in a multicell organism from the smallest level to the largest
Square root of 8 Times Square root of 3?
Select the items below that describe nonrenewable resources. limited last forever includes air and trees can be fossil fuels, minerals, or metals
a number decreased by 30 is the same as 14 minus 3 times the number.
Escoge la respuesta correcta. la milanesa es ______ muy famosa por toda argentina. una carne una bebida un desayuno un idioma
Help me ASAP!!! (64 ÷ -4) ÷ (-2)
The mass of a mouse is around 22 grams (0.022 kg). What is the weight of a mouse on the Moon?
I need help plz. Thank you