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 statement describes the revision, if any is needed, that corrects the sentence? "You have the answers in the back of the book," he said, "so you should c
Given graph of f(x)=k/x and g(x)=x.T(3.16;3.16) is the point of intersection of f and g. Write down the domain of f
A principal of $835 in an account at 3% per quarter simple interest
Which of these is a concept the Romantics valued? A. Imagination B. Science C. Imperialism D. Institutionalism
help me to got a answer.
In 2013, the population of the state of New York was approximately 19.65 million, and the population of New York City was 8,406,000. In 2013, how many people in
Which of these rhetorical devices was the author of the declaration using when he included words like cruelty and barbarous?
fill in the common equivalents. 1.) 662/3% = ?/?
Variable g is 8 more than variable w. Variable g is also 2 less than w. Which pair of equations best models the relationship between g and w? g = 8w g = w + 2 w
Add. Write your answer in simplest form. 2/5+2/5+3/5