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

Why is IV medication not very effective at treating infections at a burn site?
4/5 - 1/2 plz help i neeeeeeeeeed to know plz plz plz plz
Thirty-six of 80 marbles are blue. What percent of the marbles are blue?
Help! Algebraic Relationship y= x/4-1
Fill in the blank Never gonna ____ ___ ___, Never gonna let you down, Never gonna run around and _____ you.
The most basic form of ownership in a firm consists of:
HELP ME OUT PLEASEA die was rolled six times. The polls were 1,2,3,3,4 and 5. What is the mean deviation for this data!A) 3/5B) 1C) 2D) 6​
4. Each mobile device described in this chapter requires that the user have a/an ____________________ associated with services offered by the publisher of the m
Teachers, doctors, and lawyers need professional licenses in order to perform their jobs legally. Who has the authority to issue these licenses? School boards
PLS HELP!! YOU CAN SKIP THE INFO IF YOU WANT!!When rain falls to the earth, it just doesn't sit there. Instead, the rain water starts moving. Some of the precip