Answered step by step
Verified Expert Solution
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,
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started