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 happens during the cytokinesis?​
A copy machine can print 480 copies every 4 minutes. How many copies can it print in 10 minutes? :)
PLS HELP!!! I NEED THIS NOW!!! Use this table of a school bus during morning pickups to answer the question. What is the average speed of the bus between 2.8 k
1. An accident victim gets 0.5 pints (pt) of blood and 750 milliliters (mL) of an intravenous (IV) solution. What is the ratio of blood to the intravenous solut
I’m writing an essay and sm1 give me 4 good reasons why xmas is the best holiday !
Which of the following is a benefit of EFT A. Limited access B. Accessibility C. Difficulty D. Cost
what are example of medical quackery, nutritional quackery or device quackery ​
solve the equation tan(x+pi/3)=square root3/3 over the interval [0,2pi]a. pi/6 onlyb. 11pi/6 onlyc. pi/6 and 7pi/6d. 5pi/6 and 11pi/6​
write an exponential function in the form y=ab^(x) that goes through points (0,4) and (6, 2916)
3(10)+5x=26Answer this please!!​