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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started