Question: 6 and 9 in one assignment [python] sume a file containing a series of integers I puter's disk. Write a program that reads all of
sume a file containing a series of integers I puter's disk. Write a program that reads all of the numbers stored in the file and calculates their total. 6. Average of Numbers Assume a file containing a series of integers is named numbers.txt and exists on the computer's disk. Write a program that calculates the average of all the numbers stored in the file. 7. Random Number File Writer rite a program that writes a series of random numbers to a file. Each random number should be in the range of 1 through s00. The application should let the user specify how many random numbers the file will hold. 8. Random Number File Reader This exercise assumes you have completed Programming Exercise 7, Random Number File Writer. Write another program that reads the random numbers from the file, displays the numbers, then displays the following data: . The total of the numbers The number of random numbers read from the file . 9. Exception Handing Modify the program that you wrote for Exercise 6 so it handles the following exceptions . It should handle any IOError exceptions that are raised when the file is opened and data is read from it. It should handle any ValueError exceptions that are raised when the items that are read from the file are converted to a number
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
