Question: Write a Python program that prompts the user for the name of an input file and an output file. The input file is assumed to

Write a Python program that prompts the user for the name of an input file and an output file. The input file is assumed to be in the default location and to contain only integers, one per line. The program is to determine: (i) The largest number, (ii) The smallest number, and (iii) The average of the numbers. The results should then be displayed to the console as well as written to the specified output file.

For example, if the file numbers.txt contained the following:

 1 4 7 10 9 6 3 2 5 8 

Then your program would run as shown below. Note that the results would be written to the file results.txt as well as being displayed on the screen.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!