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

How does the brain tell the lungs to slow breathing
Which value from the set {3, 8, 9, 14} makes the equation true? 2n - 5 = 1189314​
Explain why a white fence appears to be white in your answer include the colors of light that your eye detects and tell how your brain interprets those colors
a rectangle has a length that is 4 times longer than it's width. If the total area of the rectangle is 121 square feet, what is the length (longer side) of the
How are photosynthesis and cellular respiration related? A. They are both used during fermentation. B. One forms glucose and the other breaks it down.
Identify the graphed linear equation. A) y = 2/3x + 3/2 B) y = 2/3x - 3/2 C) y = - 2/3x + 3/2 D) y = -2/3x - 3/2
mtDNA is transferred along material lineage
help me pls i have more work to do
I WILL GIVE BRAINIEST IF CORRECT PLEASE ASAP!! Which purpose does deposit insurance have? a. To protect financial institutions in case customers decide to with
How were minorities affected during the gilded age?