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

The specific heat of iron is 0.45j/gk. The amount of heat needed to raise the temperature of the 12 g of iron by exactly 15k?
Which is NOT a reason to use estar * A.to say how you feel B.to say where you are from C.to say where you are
1. Marla overslept __ but she still made it to work on time. Does it need a comma, colon, semicolon, or none.
Points A, B, C, and D represent the four corners of a parade route. Each unit on the coordinate plane is equal to 1 kilometer. John’s float goes from point A to
Order the integers from least to greatest 30,-15,2,-4
Choose the answer that best completes the sentence below. _________ the celebration of Halloween has changed over time, it has also kept some traditions from an
Try These questions out and I’ll give you brainliest
No category to put this under. anyone else on here in like 11th or 12th grade?
6 If a snack-size bag of potato chips has a net weight of 1.5 ounces, what is its net weight in grams? A. 47.00 gm B. 46.00 gm O C. 42.52 gm OD. 48.00 gm O E. 3
7. What were "casing blocks?" And what happened to the ones from the Great Pyramid?