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 is the missing term? Please help me.
VERY IMPORTANT QUESTION PLEASE SOLVE IT:(​
whats the defintion of physical process
Hello brainly! This is a question for all artists! As we know it is 2022, the year that will doom us all, lol. I want to know what are ways to keep yourself act
when was the 2 president born
what do you say to those people who go to foreign countries and forget their motherland?
i) Express Z1 in polar Form a) Z1=1-(2-√3)i (complex number)
Use the long division method to find the result when 3x3 – 2x2 + 2x + 1 is divided by 3x + 1.
Please solve 28 and 29 I need help
PLEASE HELP WILL GIVE BRAINLY AND 5.0 RATING