Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

First, save the five lines of data below as a text file, named scores.txt ( or whatever you want ) . Input: Abe Lincoln, 9

First, save the five lines of data below as a text
file, named scores.txt (or whatever you want).
Input:
Abe Lincoln,93,95,92,100,83
Bob Roberts,84,86,89,93,98
Charlie Chaplin,84,92,80,83,86
Denzel Washington,87,84,94,95,91
Elon Musk,93,83,100,82,98
Then, write a program that will open the file and process
the data line by line to produce output similar to
what is shown below.
Sample output:
Abe Lincoln 93959210083=92.60(6.19)
Bob Roberts 8486899398=90.00(5.61)
Charlie Chaplin 8492808386=85.00(4.47)
Denzel Washington 8784949591=90.20(4.66)
Elon Musk 93831008298=91.20(8.35)
The general format is
Name score score score score score = average (std. dev)
The second-to-last value on the line is the average value
(mean score) for that line of data. The last value is
the standard deviation, which, even if you don't know what
it is, is easy to calculate using the statistics library.
(Google "std deviation python")
Your program will open your text file, read it line by line
processing the data to produce the output shown in the sample
output.
Notice that the output has the columns lined up. Do that.
Also, consider how you would handle it if there were
different numbers of scores than just five. How would the
code be changed if the program didn't know in advance how
many scores would be in the data per person?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

a score of 60 or higher on the test?

Answered: 1 week ago