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 two numbers multiply together to equal -20 and adds to get 1
Where does gas exchange occur in a plant? a. within flowers b. inside the seed c. in the leaf d. in the roots
Once the writer of a critical essay has read a novel carefully enough to say something sensible about it, the next step is
Shakespeare wrote, lived, and died about __________________ years ago. a. 200 c. 600 b. 400 d. 1200
Write two different ways to decompose 6/10 into a sum
Using the periodic table, choose the more reactive metal. Ag or Te
Does magma form deep beneath earth's surface?
$24 saved after 3 weeks; $52 saved after 7 weeks
According to Newton's 3rd law of motion, an action creates _____. an accelerated reaction an equal action an equal and opposite reaction a force of equal action
A column graph is the same as a bar graph with bars that run vertically. a. True b. False