Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions