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
Ghella [55]
3 years ago
14

: Write a function "def countWords(string)" that returns a count of all words in an input string represented by the variable 'st

ring'.
Computers and Technology
1 answer:
Zina [86]3 years ago
3 0
We can define a word as a group of characters without a space between them. To find the words of the input string , w can use split(delimiter) which returns a list of strings which had the defined delimiter between them in the input string.

def countWords(string):
words = string.split(" ")
count = len(words)
return count

Here we set the delimiter as the space character, and returned the length of the words list. I split each step into its own line for readability, however the function could be one line:

return len(string.split())

Here, no delimiter is specified. If one isn't given, it will default to split at any whitespace, including space.

You might be interested in
Installation and the ongoing maintenance of software in a database system are the job of the database __
prisoha [69]

Answer: system administrator

Explanation:

The responsibilities of the database system administrator are as follows:

1. Should be able to identify the needs of the different users and their associated databases and install software as and when required.

2. making sure that the database is functionally efficiently as well as the associated software's.

3. Updation of the software and their maintenance along with the databases.

4. Backing and restoring of the databases in situation of different data loss hazards.

4 0
3 years ago
To save time and avoid formatting errors, you can use the__ to apply custom formatting to other places in your presentation and
rjkz [21]
One way to save time and also avoid errors in formatting is to use the Format Painter in applying custom formatting in other places in your presentation easily and quickly. Using such will not only save your time but also guarantee an excellent presentation. 
4 0
4 years ago
Write a method that determines the total number of chars in each string of an array.
Serjik [45]
The total number of chars in each string is basically the size of each string.

Using JAVA:

        String[] arr = {"hello", "my", "name", "is", "Felicia"};                int count = 0;        for(int i = 0; i < arr.length; i++) {            count = count + arr[i].length();            System.out.println("Characters in " + arr[i] + ": " + count);        }

Output: 
<span>Characters in hello: 5
Characters in my: 7
Characters in name: 11
Characters in is: 13
Characters in Felicia: 20</span>


8 0
3 years ago
Your IT manager wants you to set up three computers to appear to users as one powerful Windows Server 2016 server. What capabili
Marina86 [1]

Answer:

The answer is "Clustering"

Explanation:

Clustering is a technique, which includes the Microsoft Windows and the coordination with an individual multi-PC's, that is mostly connected to the local area network, as a single platform.

  • It is cheaper than one device.
  • It enables you to greater machine performance and increases usability and reliability, that's why the answer to this question is "Clustering".
4 0
3 years ago
Write a class of complex numbers consisting of:
Gnom [1K]

Answer:

hi sorry for not knowing the answer

but please follow have a great day,night, or afternoon

3 0
3 years ago
Other questions:
  • You try to enter your name into a cell that accepts a numeric value. What error would you receive
    12·2 answers
  • Are mechanical keyboards more expensive than membrane keyboards?
    9·2 answers
  • Tables draw your attention to specific information in a spreadsheet. Please select the best answer from the choices provided T F
    10·1 answer
  • Windows uses a memory-management technique known as ________ to monitor which applications you use most frequently and then prel
    8·1 answer
  • What type of link is used to call this file shown below?
    5·1 answer
  • Consider a two-link network where Host A is connected to the router by a 1 Mbps link with 10 ms propagation delay and the router
    6·1 answer
  • How do I delete my brainly account?<br> I don't need anymore.
    13·2 answers
  • . Write a C++ Code to get a multiline statement Str1 from a user with a ‘$’ as return character (Hint:
    6·1 answer
  • A falsh movies consist of how many frame? ​
    12·2 answers
  • Components of document merging?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!