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

Lichens, like the one shown in the picture below, are usually combinations of algae and fungi that have a beneficial “mutualistic” relationship know as _____? s
Help me, Take ur time, thank uuu!! by the way IFu put an absurd answer u will get reported! :)
Find the measure of the missing angle. 130° 25° ?
Write a short CER response using our previous learnings to answer the question: Why is it important to learn about conflicts that have happened in other countri
Fill in the blanks and explain the pattern.1/2, 1/6, 1/18, 1/54, ___, ___, ____​
pplllleeaaassseeeee hellppppp meeee this is easy but i dont get it
√57^2 = x Please find x.
One estimate shows that the number of people without access to safe drinking water is about one billion. How much water is required if each person who does not
If a football player Ganes 40 yards on a play but on the next play he loses 10 yards what was the total yards before the game if you ran for another 60 yards
HELPPPPP Calcium-41 has a half-life of 80,000 years. At the end of 240,000 years, how much Calcium-41 would remain in a sample initially containing 60 microgra