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

find the volume of the pyramid
Hip-hop is not something we do, it's something we live. It's the way we dress, the way we talk . . . everybody bobbing to the same beat. It's a culture, and you
What is the slope-intercept form of a line that passes through points (2, 11) and (4, 17)?
Identify two macroscopic characteristics of water that are a result of its molecular structure, and describe how each characteristics is related to the molecula
PLEASE HELP!!!!!!!3. An apartment complex has 20 apartments. The number of bedrooms is represented in the box-and-whisker plot as shown. Label all the followin
Which linear regression equation best fits the given points? (0,4), (1,4), (2,5), (3,6), (4,6), (5,6), (5,7), (6,7) A. yˆ=12x B. yˆ=−12x C. yˆ=−12x+4 D. yˆ=12x+
math question down below
An instrument with a longer tube or larger body has a ______ natural frequency.
The main argument made by antiwar groups, such as the SNCC and SDS, against American efforts in Vietnam was that
25 POINTS!!!!!!!! Ecris en Francais la partie de la phrase qui n'est pas la. _____ est la. (no one) Answer: Personne Je vais ______ le mois prochain. (to trav