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

Can you please help on this problem
A ball is thrown horizontally from the top of a 66 m building and lands 90 m from the base of the building. Ignore air resistance a) How long is the ball in the
Tyler order a meal that cost $15if the tax rate is 6.6 percent how much is the sale tax on Tyler meal,how much of a tip I should leave?​
Want to choose 2 letters ,without replacement, from 5 letters
20 points!!!!! The table represents a linear function
Use the balanced chemical equation below to answer the following: How many moles of oxygen are required to react along with 6 moles of butane (C4H10) according
12) WILL GIVE BRANLIEST 100 POINTS Which MOST CLOSELY identifies the author's purpose for writing this text? -)) The author indicates that efforts to identify
Name the following FBr. ?
hi, if your looking for extra points (50+) and brainiest here is ur chance, answer this question correctly plz
The center of a circle bs located at 3,9), and the evde hesa vedles that to sustain What the parengtame een hee) 0 #4 - 6 = 46 + 6 = () 7* 9-6-167-15-6 0676x* 1