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

Which graph represents the linear equation below y+1=2/3(x-6)
Please help me with all I will mark you brainly
How would ancient astronomers from Silla have observed the movement of stars and other objects compared to astronomers today?
can someone help me please with the ixl problem ??? If x < 0 and y < 0, where is the point (x, y) located?
Which of these statements is true: 1) It is not uncommon for most of the people in the top 5 percent of income-earners to be 45 years old and up. 2) Three-quar
the length of a rectangular is one less than twice the width. Find the length + width, if the perimeter is 40
Identify explicit formula for the sequence 3, 6, 9, 12, 15, ...
How do you drown a blonde?
In the figure, angle A measures 38 degrees and angle D measures 26 degrees. What is the measurement of angle E?
26. Which of the following is an equation for the line that is perpendicular to the line y = 2x - 9 and passes through the point (-4,5)? A. y = 2x+7 B. y = -1/