enter number to quit> enter number to quit> enter number to quit> enter number to quit>- enter number to quit>- enter number to quit> enter number to quit>the average of the numbers is we finally have an excellent solution to our original problem you should study this solution so that you can incorporate these techniques into your own programs file loops one disadvantage of all the averaging programs presented so far is that they are interactive imagine you are trying to average numbers and you happen to make typo near the end with our interactive programyou will need to start all over again better approach to the problem might be to type all of the numbers into file the data in the file can be perused and edited before sending it to program that generates report this file-oriented approach is typically used for data processing applications back in we looked at reading data from files by using the file object as sequence in for loop we can apply this technique directly to the number averaging problem assuming that the numbers are typed into file one per linewe can compute the average with this program average py def main()filename input("what file are the numbers in"infile open(filename,' 'sum count for line in infilesum sum eval(linecount count print("\nthe average of the numbers is"sum countmain(in this codethe loop variable line iterates through the file as sequence of lineseach line is converted to number and added to the running sum many programming languages do not have special mechanism for looping through files like this in these languagesthe lines of file can be read one at time using form of sentinel loop we can illustrate this method in python by using readline(rememberthe readline(method