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]
4 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]4 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
There are three managerial skills listed that a good administrative medical assistant (MAA) should prosses
Yuliya22 [10]
Ask for detalls follow report
5 0
4 years ago
To resolve a domain name on the internet, the dns resolver first contacts:
777dan777 [17]
If it can't find the answer in it's own cache, it will contact one of the name servers that it was configured to use.
8 0
3 years ago
ASAP: Type the correct answer in the box. Spell all words correctly.
DerKrebs [107]

Answer:

has?

Explanation:

i think i need a few more details then we can talk

4 0
3 years ago
Label the parts of the plated salad.
sesenic [268]

Answer:

   3. Base (<em>under line</em>): usually a layer of salad greens that line the plate or bowl in which the salad will be served.

   2. Body (<em>main part</em>): consists of the main ingredients.

   1. Garnish: enhances the appearance while also complementing the overall taste; must be edible.

Dressing: liquid/ semi-liquid added to the body.

Explanation:

3 0
2 years ago
How much can a INIVDA 1050 TI take? (FPS wise)
mafiozo [28]

Answer:

At full graphics (ultra settings, full HD resolution), tests can range from 60-65 fps, 65.5 fps being the max.

Explanation:

You can benchmark graphics cards using in-game stress tests/benchmark tests or using a separate benchmarking software.

NVIDIA 1050 Ti's are now slightly outdated. Nevertheless, it is now significantly cheaper.

3 0
3 years ago
Other questions:
  • Which of the following is the correct syntax for a hyperlink:
    7·1 answer
  • Write a program that prompts the user to enter a three digit integer and determine whether it is a palindrome number.
    12·1 answer
  • Controls that are used to assess whether anything went wrong, such as unauthorized access attempts, are called ________ controls
    5·2 answers
  • The total revenues for a company are $150,223 and the total expenses were 125,766. If you are calculating the net income, which
    10·1 answer
  • In an inspection, usually the first thing an inspector will want to see is:
    14·2 answers
  • Which is a reason why an organization might get rid of its entire information processing unit?
    10·1 answer
  • QUESTION 56 Use the Windows ________ to check on a nonresponsive program. Backup utility Error-checking System Restore Task Mana
    6·1 answer
  • Why do we say that IP provides ""best-effort"" service?
    11·1 answer
  • What is a transducer? A. an energy-converting device B. a sensing device C. a robot movement D. a signal display unit
    8·1 answer
  • The specialized programs used by the operating systems to help ensure that memory is used properly and there are no memory confl
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!