fin = open("students","r")
for line in fin:
line = line.split()
if len(line) > 1:
name = line[0]
grades = map(float, line[1:])
mean = sum(grades) / len(grades)
print( "{:<10}: {:>5.2f}".format(name,mean) )
solved python calculating average grade from a reading file