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

All of the following are rivers in the fertile crescent except for the _____.tigrisnilejordaneuphrates
A medication with antagonistic properties is one that.
Help find tqs I’ll give brainlist
When asking somebody…Is it …do you know somebody that ( does ) tattoos or do you know somebody that ( do ) tattoos?
PLEASE HELP!!!!!!! You compare the gas generated from a reaction using two antacid tablets with the gas generated from a reaction using four antacid tablets (co
ABO blood group determination is a example of
What are the coordinates of the image of the point (-4, 3) after a rotation of 90 degrees counterclockwise around the origin followed by a translation of 1 unit
Mateo wants the words "it’s snowing!" to appear in the output box and typed print (it’s snowing). this didn’t work. what needs to be added to the code?a. quotat
why argon is called inert element?​
Rewrite 4 as a fraction. 4/4 4/1 1/4