if __name__ == "__main__":
grades = []
average = 0
with open('input.txt', 'r') as file:
for line in file:
grades.append(float(line))
average += float(line)
average /= len(grades)
above_average = 0
below_average = 0
for grade in grades:
if grade > average:
above_average += 1
elif grade < average:
below_average += 1
print("Above average grade: " + str(above_average))
print("Below average grade: " + str(below_average))
Comments
Leave a comment