Question: USING PYTHON PROGRAMMING LANGUAGE Write a program that opens a file named scores.txt. On each line of this file, there is a name and some

USING PYTHON PROGRAMMING LANGUAGE

Write a program that opens a file named "scores.txt". On each line of this file, there is a name and some scores. Your program should create a new file named "averages.txt". Each line of this file should contain the name and that person's average score.

follow these instructions please! And attach a picture of the solution.

#Open scores.txt

#Get a list of the lines in the file

#Close the file

#Use a list comprehension to split each line of the file

#Use a list comprehension to obtain the names

#Use a list comprehension and the following function to obtain the scores

def strs_to_ints(list_of_strs):

return [float(item) for item in list_of_strs]

#Use a list comprehension to obtain the averages

#Open averages.txt for writing

#Use a list comprehension to write each line

#Close the file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!