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

Students at a high school were asked about their favorite outdoor activity. The results are shown in the two-way frequency table below. Fishing Camping Canoeing
What is the theme of "The Story of the Fisherman”?
Help me with english (EASY FOR YOU) 50 POINTS
seen in some Gram-positive bacilli, occurs when only the inner portion of a cell wall is deposited across the dividing cell. This new cross wall puts tension on
Based on the trends shown in this chart, which of the following predictions best tell about the U.S. population in 2020? (3 points) I. More than half of the U.S
Llama have 74 chromosomes how many chromosomes will they be found in their gametes explain how you know
Ted wants to go out to a neighborhood park and shoot pictures of dew drops on grass. He wants to get a low-level angle of the dew drops. Which support equipment
During world war ll, the untied States was a member of the Allies Axis European theater Pacific theater
Facilitates growth and change in neurons and the migration of neurons to different sites in the brain
Which of these can an adverbial clause modify?