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

When atp breaks down to adp, potential energy stored in bonds is released. this energy stored in bonds is __________ energy?
can someone please help with problem 1
In 2007, michael carter (u.s.) set a world record in the shot put with a throw of 24.77 m. what was the initial speed of the shot if he released it at a height
The main difference between a prokaryotic cell and a eukaryotic cell is A) the ability to grow. B) the ability to reproduce. C) the presence of nucleic acids
What is the historical significance of Virginia’s House of Burgesses??
Why do scientists like to give every organism its own scientific name?
what effect did the printing press having on the number of books produced and their selling price?
A big movie theater had 1,200 seats. 864 of the total number of the seats were sold. what percentage of the seats was sold
Sean wants to go to a two day music festival at the end of summer. Tickets for the festival cost $190. How many lawns will Sean need to mow this summer to earn
HELP!!!!!!!!!!!!!!!!!!!!!!!