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

Please help on number 3.
There is a force between two charges; if the distance between the two charges is doubled, by what factor does the force between them change? Doubles Halves
What year was the sufferagettes act?
Your patient care task requires gloves, a gown, googles, and a mask. From this list which item of PPE should always be put on first?
please hurry!!! Find its volume.
Which type of music is a secular musical form of the medieval era?
Solve. −3/4 (x + 1/2) + 7/4 x = 3/8 Enter your answer in the box as a fraction in simplest form. PLEASE HELP!
Appointment reminder letters help to decrease the number of appointment no-shows.True or false (this is a trick question. )
PLEASE HELP (their is a picture) I AM DESPERATE (part b)
If the circumference of the circle below is 72, what is the length of XY (the minor arc)?