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
Masteriza [31]
3 years ago
7

Write a function called st_dev. St_dev should have one #parameter, a filename. The file will contain one integer on #each line.

The function should return the population standard #deviation of those numbers.
Computers and Technology
1 answer:
kodGreya [7K]3 years ago
6 0

Answer:

  1. import statistics
  2. def st_dev(file_name):
  3.    with open(file_name) as file:
  4.        data = file.readlines()
  5.        numList = []
  6.        for x in data:
  7.            numList.append(int(x))
  8.        
  9.        return statistics.pstdev(numList)
  10. print(st_dev("text1.txt"))

Explanation:

The solution code is written using Python.

To ease the calculation task, we can import Python statistics module to use the pstdev method to calculate the population standard deviation of a list of numbers (Line 1).

Next, create a st_dev function that take single argument file_name (Line 3). In the function, it will open the input file and read the data line by line (Line 4-5). Create a for loop to traverse through each line of the data which is an integer and append it to numList (Line 7-8). We can pass the numList to pstdev method (Line 10) and return the resulting standard deviation value as output.

We test the function by passing a file which hold a list of integer values in each line (Line 12).

8

9

12

11

21

15

16

10

7

13

And the output we shall get is 4.019950248448356

You might be interested in
STEAM game launcher question.
son4ous [18]

Answer:

Try to look up csgo map maker and you might be able to transfer the file

Explanation:

4 0
3 years ago
BI systems have eliminated a common organizational problem, which is simultaneously having too much data but somehow not enough.
lyudmila [28]

Answer:

True

Explanation:

Most of the organization suffers from InfoObesity, i.e., too much data without the proper holding structure for this.

Business intelligence abbreviated as BI plays a major role in the determining the planning strategies of an organizations and serves multiple purposes which includes measurement of performance towards business objectives, quantitative analysis, data reporting and sharing, etc.

BI systems helps in eliminating InfoObesity, by manging the data and filtration of the data with proper data structure to serve specific purposes.

8 0
3 years ago
A reflective cross-site scripting attack (like the one in this lab) is a __________ attack in which all input shows output on th
Murrr4er [49]

Answer:

" Non-persistent" is the right response.

Explanation:

  • A cross-site category of screenplay whereby harmful material would have to include a transaction to have been transmitted to that same web application or user's device is a Non-persistent attack.
  • Developers can upload profiles with publicly available information via social media platforms or virtual communication or interaction.
6 0
3 years ago
A computer can manipulate symbols as if it understands the symbols and is reasoning with them, but in fact it is just following
Law Incorporation [45]

Answer:

The symbols may or may not have meaning, but the machine does not need to know how the symbols are interpreted in order to manipulate the symbols in the right way.

Explanation:

The computer can change the symbols in the case when the computer understand but in actual following the cut-paste rules without having any understanding this is because the symbols might be have meaning or not but if we talk about the machine so actually they dont know how the symbols are interpreted and how it can be used so that it can be change in the accurate way

5 0
2 years ago
Application software helps run the computer and coordinates instructions with the hardware. select one:
Natalija [7]
The computer technology that allows us to develop three-dimensional virtual environments (VEs) consists of both hardware and software. The current popular, technical, and scientific interest in VEs is inspired, in large part, by the advent and availability of increasingly powerful and affordable visually oriented, interactive, graphical display systems and techniques. Graphical image generation and display capabilities that were not previously widely available are now found on the desktops of many professionals and are finding their way into the home. The greater affordability and availability of these systems, coupled with more capable, single-person-oriented viewing and control devices (e.g., head-mounted displays and hand-controllers) and an increased orientation toward real-time interaction, have made these systems both more capable of being individualized and more appealing to individuals

4 0
3 years ago
Other questions:
  • How does the use of modules provide flexibility in a structured programming design?
    14·2 answers
  • Assure that major, minor, sub1 and sub2 each contain four digit numbersIf less than four digits are entered in major OR minor OR
    5·1 answer
  • Which of the following can be both an input device and an output device? mouse. keyboard. display screen. laser printer .
    9·1 answer
  • Write code statements to create a DecimalFormat object that will round a formatted value to four decimal places. Then write a st
    15·1 answer
  • Which types of computers are used by large businesses
    10·1 answer
  • <br> Help me please I need the correct answe
    10·1 answer
  • What is presentation
    15·2 answers
  • What department is cyber security
    6·2 answers
  • Red + blue =<br>Red + green =<br>Magenta - blue =<br>Yellow - green =<br>Cyan - blue =​
    9·1 answer
  • How many 2/8 pound patties can she make from 7/8 of a pound of hamburger
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!