I have written almost all of my program, except I am stuck on this certain part. I need to write an averege out to figure all students final grades out as a statistic of the course. Students name and final grade have been appended to an external file(keep in mind more students and grades can be appended)...here is what I have so far, any input is highly appreciated if my code is wrong please don't hesitate in letting me know. Thank you.
fname = input("What is the file name?")
file1 = open(fname,'r')
sum = 0.0
count = 0
for line in file1:
sum = sum + eval(line)
count = count + 1
print("\nThe average of the numbers is", sum/count)