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
Consider the pseudo-cpu discussed in class. the instruction format is 16 bits, which is subdivided into 4-bit opcode field and 1
sp2606 [1]
I need a picture or an answer choice
6 0
4 years ago
What are the different parts of a word processing program?<br><br> I need this ASAP please help!!
uranmaximum [27]

Answer:

The basics of the Word window

Title bar. This displays the document name, followed by a program name.

Menu bar. This contains a list of options to manage and customize documents.

Standard toolbar. ...

Formatting toolbar. ...

Ruler. ...

Insertion point. ...

End-of-document marker. ...

Help.

3 0
3 years ago
Different project management steps are initiating, planning, executing, monitoring and controlling, and closing a project. Which
ser-zykov [4K]

Answer:

All steps of project management until the closure of the project are very critical and important for the success of the project.

Explanation:

The steps that are very critical and important for the success of the project.

Initiation:

This is a very beginning step of any project in the project management practices. In this step, mainly, project feasibility is carried out and drafted. at this step, management takes decisions that this project would be profitable or not for the organization. If proper measure and future prediction do not measure properly then this stage would affect the project success criteria. Because, if the base of any project is built on the wrong steps and measures, will lead to failure. At this stage, management takes the decision based on a feasibility document and business case document to ensure if it feasible or profitable to the organization.

Planning:

This is a very crucial step of project planning, and mistakes in this stage will lead the project toward failure. after receiving the green signal at the initiation stage, the proper project plan is carried out in a documented form. This project plan will guide the project manager and all stakeholders of the project in making the project successful. So, a well-written project plan is very critical and important for project success than any other phase of project management. Because the project plan gives the direction to the team to carried out the project execution process smoothly, it helps in handling risk and mitigation strategies to solve the risk, finance management, task management and in achieving timely deliverables.

Execution:

The planning phase and execution phase are most commonly associated with project management. This phase of project management is all about building deliverables and ensure timely delivery to customers for their satisfaction.  Team leader and/or project manager make this happen by allocating the required resources to develop the deliverables and keeping team members focus on their assigned tasks. This phase relies on the project  planning phase.

Monitoring and Controlling:

Monitoring and controlling are sometimes combined with the execution phase of the project because they often occur at the same time and carried out parallel to each other. At this stage, team performance, progress, and other project-related matrices are carried out to track their own progress. In this stage, key performance indicators are calculated, track variation from allocated resources such as cost and time, etc. This stage is important for project success, because if you don't deliver the quality and timely work then you may linger the project that directly affects the project cost and time.

Closure:

The team closes the project as they finished the project and customers/stakeholders approve the project output i.e product and then release the resources. This step is not crucial for project success as other all of the previous stages. but at this stage, effective communication, document finalization, and lesson learned document are required.

6 0
4 years ago
Whats the flow in this code, and whats the risk that its creating and what can i do to fix it? (c language)
Advocard [28]

Answer:

The risk is a buffer overflow.

Explanation:

Whatever the user passes as a command line argument, will be copied into the buffer. If the user passes more than 499 characters, the end of the buffer will be overwritten.

To solve it, compare the string length of argv[1] to 500 before copying, or even better, start using the new strcpy_s( ) function.

6 0
3 years ago
Which describes the first step a crawler-based search engine uses to find information?
Orlov [11]
<span>Crawler-based search engines are what most of us are familiar with - mainly because that's what Google and Bing are. These companies develop their own software that enables them to build and maintain searchable databases of web pages (the engine), and to organise those pages into the most valuable and pertinent way to the user.</span>
5 0
3 years ago
Read 2 more answers
Other questions:
  • Which computer device helps you input data in the form of text, numbers, and commands?
    9·1 answer
  • How would a static local variable be useful?
    5·1 answer
  • If a database is not maintained or if incorrect data is entered into the database, serious problems can occur. What problems cou
    15·1 answer
  • Dave wants to host a website and he needs an operating system that is free of cost. Which operating system should he use?
    11·1 answer
  • “Artificial intelligence is the tool of education in the near future”. Research on the possibility of “AI technology” in scienti
    15·1 answer
  • Hi Alaza, when you submit this form, the owner will be able to see
    12·1 answer
  • How many sections of a job description are there
    5·1 answer
  • Jim wants to shoot a video. This requires him to move from one place to another. Which type of camera support should Jim use?
    13·1 answer
  • Select three advantages of cloud computing.
    12·1 answer
  • Programs for embedded devices are often written in assembly language. Some embedded processors have limited instructions, like M
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!