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
You use the Paste Options button labeled ____ if you want the pasted chart not to be linked to the source document and you want
Semenov [28]

Answer:

Keep Source Formatting & Embed Workbook

Explanation:

Source formatting is used to apply the formatting from source document while copying and pasting.

Source is the place where the data is already placed and we want to move it make a copy of it on some other document. So if we don't want to change the formatting of source document, we choose source formatting from the options while pasting.

Embed is used to whenever we don't want to link the formatting with source document.

So,

You use the Paste Options button labeled <u><em>Keep Source Formatting & Embed Workbook</em></u><em> </em>if you want the pasted chart not to be linked to the source document and you want the pasted chart to keep the formatting from the source document.

8 0
2 years ago
Read 2 more answers
ROM is designed for _________
Sidana [21]
Computer Instructions

ROM, or Read Only Memory is used to store instructions as it retains memory even after power loss.
6 0
3 years ago
What is the difference between concrete language and abstract language? give an example of each.
saul85 [17]

The difference between abstract language and abstract language is that abstract language is known through the intellect and concrete language is known through the senses.

<h3>What are abstract and concrete languages?</h3>

The abstract language uses the words like kind, truth, grace, etc. It is a form of language that indicates the intellectual, but concrete language can be known by the senses.

Thus, the distinction between concrete and abstract language is that concrete language is understood via the senses, whereas abstract language is understood through the mind.

To learn more about abstract and concrete languages, refer to the link:

brainly.com/question/16550006

#SPJ4

7 0
1 year ago
You need to install a customized console on 10 computers. what is the best way to do that?
ICE Princess25 [194]
So you're going to simply create, copy, and paste!  You're going to create your first console on the first computer, and the you'll be left with a .mmc file which you're going to copy and paste to the other nine.  As long as you can get that file over through a shared server connection, you should be fine!
6 0
2 years ago
Which of the following Sales Hub tiers have access to work-flows (HubSpotâs automation platform)?
Minchanka [31]

Answer:

The following Sales Hub tiers have access to work-flows:

C) Sales Hub Professional and above.

Explanation:

  • HubSpot is a management software that helps individuals and companies to keep their business growing by providing services in different categories like marketing, sales, customer support, etc.
  • The Sales Hub professional software has the access to work flow that feature is not present in the free hub spot CRM so the option A is not correct. The option B doesn't true because the Sales Hub Starter doesn't have that feature of work flow.
  • The option D is also incorrect as Sales Hub Enterprise is not the only version that has the feature of access to the work flows.

8 0
2 years ago
Other questions:
  • Write a program that uses the function isPalindrome given in Example 6-6 (Palindrome). Test your program on the following string
    9·1 answer
  • 1. What arguments can you make for the idea of a single language for all programming domains
    10·1 answer
  • Discus the pros and cons of Internal cloud service and External cloud service for both Infrastructure as a service and Applicati
    11·1 answer
  • Namecoin is an alternative blockchain technology that is used to implement decentralized version of Routing Banking System.A. Tr
    14·1 answer
  • How do i move a file in python3
    10·1 answer
  • What is your favourite video game??​
    5·2 answers
  • What is the difference between a crosstab query and a subquery?
    11·2 answers
  • You are a software engineer at a company where management routinely encourages you and your colleagues to use pirated software.
    5·1 answer
  • You are the IT security administrator for a small corporate network. The HR director is concerned that an employee is doing some
    13·1 answer
  • where element is the Hypertext Markup Language (HTML) element and _____ pairs define the styles that are applied directly to tha
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!