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
dusya [7]
3 years ago
10

Write a function called word_count that takes a single argument, a string containing the text of a single chapter, and returns t

he number of words in that chapter. Assume that words are separated from each other by spaces. Apply your function to compute the variable wc (defined in the cell below).
Computers and Technology
1 answer:
Ratling [72]3 years ago
3 0

Answer:

Hi there! There are a number of ways to achieve the word count result given an input text. The easiest method is explained below.

Explanation:

A simple Python script, word_count.py, can be used to calculate the word count program. The first argument is taken as the input text string (it needs to be enclosed in quotes (" ") in the command line). This input text is then split by spaces to capture the complete words list in an array. Finally, the length of the array equals the word count.

word_count.py

import sys;

text = sys.argv[1];

words = text.split(" ");

wc = len(words);

print(wc);

You might be interested in
List the five body functions that monitor homeostasis.
IceJOKER [234]
You can also have homeostatis by shivering and sweating

6 0
3 years ago
What does the “MIN” and “MAX” functions allow you to do when inserted in a spreadsheet?
Aleks04 [339]

Answer:

Please see explanation

Explanation:

A spreadsheet is used to make calculations and payrolls etc. Different functions are used in spreadsheet. Two of them are MIN and MAX.

The MIN function gives the minimum value out of all the cells in the range.

It is written as:

= MIN(number1, number2..)

OR

= MIN(Starting_cell_address:Last_cell_address)

Similarly, MAX function gives the maximum value from the selected range of cells.

= MAX(number1, number2..)

OR

= MAX(Starting_cell_address:Last_cell_address)

7 0
3 years ago
According to the lecture, in communication, men tend to value ____________.
Andru [333]

Answer:

respect?

Explanation:

8 0
3 years ago
Ensuring that users have access only to the files they need to complete their tasks is an example of which principle? A. Separat
Flura [38]

Answer:

Least Privilege

Explanation:

The principle of least privilege an important principle in computer security. It is the practice of limiting access rights for users to the basic minimum or least amount of privilege they require to perform their tasks. For example a user is granted privilege to execute a file or manipulate data or use resources they require to perform a function or task. Therefore, this principle can be used only to limit access rights for programs, systems, and devices to those permissions only that are required to carry out permitted activities. Conforming to principle of least privilege reduces the risk of hackers gaining access to sensitive information or a system, by compromising a user account or device. For example an individual whose task is to enter data into a database only requires option to add records to that DB by the principle of least privilege. If a virus attacks the computer of that individual, this attack is restricted only to creating DB entries.

5 0
3 years ago
HOW DO I TURN THE CAPS LOCK OFF???? PLEASE HELP IT WONT STOP!!!!
svlad2 [7]

Answer:

Press the caps lock key

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • Write a for loop that iterates from 1 to numbersamples to double any element's value in datasamples that is less than minvalue.
    15·1 answer
  • Which of the following is NOT a place where you are likely to encounter a pedestrian?
    5·2 answers
  • While inspecting an element in the DOM on my website using the Chrome Devtools I accidentally deleted the DIV that had all my au
    8·1 answer
  • Which method deletes a footer from a document?
    13·2 answers
  • Design a class named QuadraticEquation for a quadratic equation ax^2+bx+x=0. The class contains: **private data fields a, b, and
    11·1 answer
  • Advatages and disadvantages of power-concentrated train​
    6·1 answer
  • Convert the following pseudocode to C++ code. Be sure to define the appropriate variables. Store 25 in the speed variable. Store
    5·1 answer
  • The following pieces are known as (image shown above)
    15·2 answers
  • If u play codm pls tell me ur username
    9·2 answers
  • How to share excel file for multiple users office 365?.
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!