You can open and close the input file twice. This is just a recommendation. You’re welcome to find a more effective way.For the first time when you open the input file, you can get the total of all grades and the counter in order to calculate the average. You will needoA for loop or a while loop to read a grade at a time: e.g., for line in infile:For the second time when you open the input file, you can compare each grade with the average to determine if the grade is above or below the average. You will need oA for loop or a while loop to read a grade at a time: e.g., for line in infile:oConversion from a line (string) into a float: e.g., grade = float(line)oA condition structure to determine if the grade is above or below the average: e.g., if-elif statementoA counter for the number of grades above the averageoAnother counter for the number of grades below the average