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 is socio religious reform?​
2m+6=100 what is the value of m
Sometimes it can be difficult to measure unemployment in an economy because some people who have been actively looking for jobs may be discouraged to do so afte
PLEASEEEEE HELP MEEEEEEEEE
Explain the NAture Vs. Nurture Argument. In your analysis you must include the ideas of instincts, drives, and tabula rasa
what is socio religious reform?​
Maiheinalersy SECTION A QUESTION ONE ANNEXURE A: DATA COLLECTION ANSWER SHEET TERM 2024 GRADE 12 NAME GRADE 12 1.1 Prices of items listed in the table below wer
what's 200 subtracted from 33
Question: Why did I learn English not fast ?
What mass of MnO2 is produced when 445 grams of H2O are reacted? H2O 2MnO4− Br− → BrO3− 2MnO2 2OH−