Question: 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,
Bob Roberts,
Charlie Chaplin,
Denzel Washington,
Elon Musk,
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
Bob Roberts
Charlie Chaplin
Denzel Washington
Elon Musk
The general format is
Name score score score score score average std dev
The secondtolast 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
