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

528 a weekend. 10% of 480 is 48 480 + 48 = 528
Please help! What is the first step in solving the function below?
Involves manipulating information mentally by forming concepts, solving problems, making decisions, and reflecting in a critical or creative manner.
Evaluate the expression. 7^14/7^15 Evaluate the expression . 714 715​
This is all the questions I need answers to: A two-digit locker combination has two non-zero digits and no two digits are the same. Event A is defined as choosi
Shays' Rebellion demonstrated the weaknesses of the Articles of Confederation. Select one: O True False
. What characteristics of this Royal Pedigree fit with the expectations for an X-linked, recessive disorder?
. Find the general solution to d²y/dx²= 49y. Enter your answer as an equation y = .. Note: d²y/dx²=k^2y
The record number of points scored in one nba game by a single player was 100 points set by who?.
Which quotations from the excerpt provide evidence to support the claim that governments have responded to criticism delivered through social media? Select thre