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

Which description of Igor Stravinsky is accurate? A. He was an engineer who designed and built the Eiffel Tower for the 1889 World's Fair in Paris. B. He was th
HELP PLZ :) Ping-pong balls numbered 0 to 9 are placed in a container and one ping-pong ball is drawn. To win the prize, a participant must correctly identify t
Which animals are at the greatest risk for anthrax?
Which plan called for a bicameral legislature in which representation in both houses would be based on population proposed by james madison?
Suppose you are told that the number of X Station gaming consoles increased linearly for the month of December. What can the slope of the linear regression tell
Please help me with this
WILL GIVE BRAINLY!! For the data in the table, does y vary directly with x? And if so write an equation for the direct variation. X= 16,32,48 Y= 4,16,16 A. yes;
What do scientists call the movement pattern of deep ocean currents? A. Deep Current Surge B. Rapid Ocean Current Flow C. Current Conveyor Flow D. Great Oc
An example of a start-up cost is _____. -employee salaries -paying a graphic designer to create a logo -health insurance -rent
Someone please help me