Question: Lab 2B - try/except 100 pts Your program should also handle the following errors: ERROR OUTPUT If there is no file called Data.txt No file

Lab 2B - try/except 100 pts Your program should also handle the following errors: ERROR OUTPUT If there is no file called Data.txt No file found If the first line of the list is not an int Data file not compatible Directions: Write a program that will read in a list of Integers from a file called Data.txt which is supposed to contain the following information in the following format Integer - line 1 next integer next Integer next integer next integer next Integer If there are not enough lines of data because the first int in the file is wrong Just make a list with the existing data. Output a messape before the list prints saying that there was a mismatch between expected and actual data If one of the lines of data is not an int Skip adding that line to the list - Output a message before the list prints saying some data not valid' Integer - line 1 is the number of remaining lines in each file. next integer is supposed to contain just an integer - but might have errors on certain lines if a math error occurs This function produces an ERROR Write the code that will place all the next Integer values in a list. Write a function that takes the square root of the sum of all the values except the last one and returns that answer divided by 10 rounded off 1 decimal place. File Edit Format View Help 5 2 3 7 4 10 The numbers 2, 3, 7, 4, and 10 would be placed in a list. The function would add the 2, 3,7, and 4. It would return the square root of that sum divided by 10. . Testing your code requires the following output: printing each element of your list vertically printing a call to your function using that list using the following format: "The function produces function call> Sample Output using the above file 2 3 7 4 10 The function produces 0.4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
