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

Given the expression: 5th + 6b + 7c.Sendo a = 1, b = c = -7 and 10.What the numerical value of the given expressõa?
Today there are several areas throughout Canada where indigenous peoples have local or regional control. _______ became the largest in 1999.
what were rembrandt’s pieces characterized by?
what is the general form of the equation for the given circle? x2 y2 − 8x − 8y 23 = 0 x2 y2 − 8x − 8y 32 = 0 x2 y2 − 4x − 4y 23 = 0 x2 y2 4x 4y 9 = 0
what is one of the benefits of genetically modified food?
The difference of 5 times a number and 8 is 27. which equation below can be used to find the unknown number?
mis padres _____ muy simpáticos.
the primary language spoken in brazil is spanish
in a rock concert ,2/7 of spectators purchased 1000rs tickets while remaining 15000 purchased 500rs tickets. how many spectators viewed the concert
how are the nervous system and the endocrine system different?