1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
irina1246 [14]
3 years ago
9

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.

Computers and Technology
1 answer:
pashok25 [27]3 years ago
3 0

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:

You might be interested in
Which term describes the process of training a machine to do simple, repetitive tasks, and adapt or correct its performance base
yKpoI14uk [10]
Automation. ... It involves taking a machine or software that was taught to do simple repetitive tasks (traditional automation) and teaching it to intuitively adapt or correct its performance based on changing conditions, at speed and scale.
8 0
3 years ago
Drivers dealing with strong emotions may take risks they otherwise would not. <br> true false
grigory [225]

This is true because some people may be going through rough times and when they aren't they probably won't feel the same way as they do when they go through tough times.

7 0
3 years ago
A top level class may have only the following accessmodifier.
GREYUIT [131]

Answer: Public

Explanation:

 A top level class can have a public, as top level cannot be private and protected because the modifier private is not allowed. As, top level is a class which is not a nested class. Interface of a access modifier is either public or no modifier. There are two types of access control modifier are top level - public and member level- private, protected.

3 0
4 years ago
An array similar to a phone book has 1000 names arranged as names [0], names[1]....names[999]. Nancy wants to search a name X in
sammy [17]

Answer:

b. The names in the list should be in alphabetical order.

Explanation:

A binary search is an algorithm used for searching for an item in a list or array. The algorithm first sorts the data structure into order and then divides it into halves. If the searched item is less than the middle item in the list, then the algorithm searches for the target in the first half, else, in the second half. This reduces the time complexity of the search.

5 0
3 years ago
How do you change between worksheets inside an Excel Workbook?
ad-work [718]

Answer:      c) Click on a different sheet tab at the bottom.

Explanation:    

To change between worksheets inside an Excel Workbook : Click on a different sheet tab at the bottom

3 0
4 years ago
Other questions:
  • Where are Micro USB connectors used the most?
    11·2 answers
  • Prove that for every nfa with an arbitrary number of final states there is an equivalent nfa with only one final state. Can we m
    8·1 answer
  • The machine should not be oiled until the
    11·1 answer
  • Create a stored procedure sp_Q1 that takes two country names like 'Japan' or 'USA'as two inputs and returns two independent sets
    10·1 answer
  • Describe the 3 different types of authentication
    6·2 answers
  • When USB flash drives started becoming popular, customers stopped purchasing CDs. As a result, USB flash drives almost completel
    5·1 answer
  • The lower band and upper band of integer data type​
    6·1 answer
  • Assume a future where security counter measures against DoS attacks are much more widely implemented than at present. In this fu
    7·1 answer
  • The most important preinstalled software is the ______ software that allows you to use the computer the first time you turn it o
    7·1 answer
  • How many free passes do you get for skipping videos and getting answers
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!