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 layer, along with the crust, forms the solid tectonic plates
27 g of Al will react with how much mass of O2 to produce Al2O3
While shopping, you see a jacket marked down 20%. If the original price of the jacket is $175, what is the sale price of the jacket
Zeno is walking in a straight line. With each step, he covers half the remaining distance between him and the end of his path, which is a total of 8 feet. After
its C right Which describes a result of the American Civil War? A. The Union and the Confederacy remained separated for ten years. B. The treaty ending the war
which feature of the United states constitution was included to address the concern expressed by James madison
how does moving the place of a digit change its value
A car with mass 615 kg drives through an Arby's parking lot. What is the weight of the car? Isn't it just w=mg So, w=615 kg x9.8 m/s^2 w= 6,027 N
50 decreased by twice a number
A(n) ____ is the act of or process of arriving at a conclusion from facts or a premise. premise inference implication