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

besides distance why can't you see across an ocean to land on the other side
What is a prepositional phrase
how to rename 71 thousands
what is the value of (3 with an exponent of 2 + 1 ) -14 divided by 2
why critical thinking and skepticism are important to scientific inquiry
Find the area of a sector with a central angel of 300 degrees and a radius of 14.6 mm. Round to the nearest tenth.
who or what determines if an area is a country
What is 98.044 rounded to the nearest thousands
what is the value of this expression 14−3 ? 12 64 112 164
Is it true or false that one result of market economies are companies which complete each other