Question: Write a complete Python program, called final.py, which will read integer values from the file numbers.txt. The program should determine the average of the

Write a complete Python program, called final.py, which will read integer values from the file numbers.txt.

Write a complete Python program, called final.py, which will read integer values from the file numbers.txt. The program should determine the average of the numbers in the file and then add that number to all the numbers less than the average or subtract from all the numbers greater than the average. You cannot read the file more than once so you should use the list to store the values. There should be a main function that calls a calcAvg(list) function which accepts a list of numbers and returns the average. Sample run: (numbers.txt has the following values) 1 2 2345 4 The average of the numbers is: 31 Adjusting the numbers in the list: 45312

Step by Step Solution

3.60 Rating (157 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer the code is as follow def calcAvgnumbers if not numb... View full answer

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 Programming Questions!