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

what expression can be used to find total discount of 30%
At the bank, brent exchanges $50 in bills for 50 one-dollar coins. the total mass of the coins is 405 grams. estimate the mass of 1 one- dollar coins
Write a paragraph explaining what the words below have in common. a. minuteman b. Loyalist c. Patriot
When was the official flag established?
IS ANYBODY GOOD AT MATH????
PLEASE HELP In "The Most Dangerous Game", how does Connell create suspense at the beginning of the story? A. The story begins with dialogue, not description. B
If the federal government wants to encourage businesses and consumers to spend more money, it would MOST LIKELY
What are 3 examples of Republicanism?
read the passage from invictus it matters not how Strait the gate ,how charged the punishments the scroll, I am the master of my fate, I am the captain of my so
How can you show two objects are proportional with a table,graph, and a equation?