Question: Write a Python program that creates a file named grades 2 . csv . The new file should contain all of the information from grades.csv
Write a Python program that creates a file named gradescsv The new file should contain all of the information from grades.csv In addition, there should be a fourth column entitled Average. For each student, the value in the new column should be the average of the two grades.
excel output:
Cooper,
Eli,
Leah,
Gabe,
Amber,
python code:
infile opengradescsvr
outfile opengradescsvw
aline infile.readline
outfile.writet"Average
while aline:
items aline.split
dataline itemst itemstitems #t items
outfile.writedataline
aline infile.readline
printaline
infile.close
outfile.close
####
#create a fourth column in excel called average while using python
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
