Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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. 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
Step: 1
Answer the code is as follow def calcAvgnumbers if not numb...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