'''process a file of students''' def main(): f = open( "Ex9_2010_input.txt", "r") line = f.readline() while len(line) != 0: print line line = f.readline() main()
In this case, the file contains comma separated values, each line representing student names and assessment marks in this format:
FirstName, LastName, Asg1Mark, Asg2Mark, ExamMark
Here are a couple of example lines from the file:
Fred, Nurke, 16, 17, 22
Jack, Sprat, 12, 13, 19
I need to modify the code i have written above to extract the different fields from each line of input and then calculate the final grade. and then i need Print out each student’s names and final grade.
Any insight in how i can approch this would be great