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

How great a temperature change occurs for a gas at 350 mm Hg and 220 L if it occupied 500 L at 0°C and 700 mm Hg?
What is the answer to a line GH passes through points (2,5) and (6,9). Wich equation represents line GH
Question 11 if condensation was occurring during the ascent from 800 mb to 500 mb, the air parcel would have ________ water vapor during the ascent
Which of these sentences is punctuated correctly? She turned around and said, "By the way, Sally, where were you on Halloween, 1998?" She turned around and said
what is empathy? a. being able to help someone make a decision about a traumatic event b. being sympathetic to someone else's situation and experiences c. under
After trying for several years to become pregnant, eli and jasmine recently found out that they are going to have a baby. they are feeling which type of stress?
Is gasoline an element compound or mixture?
From when to when did the slave trade happen
In a? triangle, the measure of the first angle is three timesthree times the measure of the second angle. the measure of the third angle is 35 degrees35° lessle
Square root 196/64 Please help me