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

Hey can anyone please give me an explanation to the conic section rules like the circle and the ellipse, parabola and hyperbola
Find the area of each regular polygon. Round your answer to the nearest tenth if necessary​
In how many years a sum of money doubles at the rate of 8%?​
"Crimes against property" are much more common than "crimes against persons." 1) True 2 False
Solve the inequality p/5 < -3
Why do tropical cyclone nivar develop in late summer ​
A right prism has a square base and volume, V, of 576 cubic centimeters. The height, h, of the prism is 16 centimeters. Find the area of the base, B. A. B. C. D
What is media logic according to David L. Altheide?
Help please,, The instructions are: find the tangents of the acute angles in the right triangles. Write each answer as a fraction and as a decimal rounded to 4
Krystal made 8 quarts of soup on Monday 5 quarts of soup on Tuesday and 5 quarts of soup on Wednesday. If she serves each guest 1 cup of soup how many guests ca