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

WILL GIVE BRAINLIEST PLEAAE HELP Yon made contributions to a Traditional IRA over the course of 35 working years. Her contributions averaged $2,000 annually. Yo
How many states lost seats in the House of Representatives after the 2000 redistricting
Anne is trying to attract her metal pencil box with a magnet from the other side of her desk. The pencil box does not move. What is most likely true? * The penc
Read the following sentences and select the correct answer from each drop-down menu. 1. Kim Il-Sung was the leader of
what might a physicit choose to study?
What is the subject noun in, The chicken on the left is the largest one.
Question 10 (10 points)Hugh wrote six checks from his account in the following amounts: $20, $20, $12, $20, $12, and $42. He also made a depositof $57 and was c
A 970 kg car starts from rest on a horizontal roadway and accelerates eastward for 5 s when it reaches a speed of 25 m/s. What is the average force exerted on t
Dave loves ———— on the phone Act rice chic Jolie bavarder eglise petit ami Centre-ville epicerie
The answer to a because I need help