Question: Please help using VS code/ python images of 6-3-lines1.txt and 6-3-line2.txt uploaded Exception Handling (adapted from #9) - Save the file as ch6_ex3.py Exceptions offer

Please help using VS code/ python images of 6-3-lines1.txt and 6-3-line2.txt uploaded

Please help using VS code/ python images of 6-3-lines1.txt and 6-3-line2.txt uploadedException Handling (adapted from \#9) - Save the file as ch6_ex3.py Exceptionsoffer a gracious way to exit a program when things go wrong.

Exception Handling (adapted from \#9) - Save the file as ch6_ex3.py Exceptions offer a gracious way to exit a program when things go wrong. Modify the program you wrote for exercise 2 to handle the exceptions (See 6.4 Exceptions on page 341). Test the program using the following text files (download from BlackBoard assignment page): 6-3-lines1.txt 63lines2.txt Your program must: - Include a try block in the main function that holds most of the code from exercise 2. - The try block must handle any: - IOError exceptions are raised when an attempt is made to open the file. - ValueError exceptions are raised when the items read from the file cannot be converted to type float. - Include all requirements outlined in "your program must" from \#2. - When you turn in ch6_ex3.py it should be set to read 6-3-lines2.txt. It will not pass CodeGrade if it is set to read 6-3-lines1.txt For the file 6-3-lines1.txt, the output should look like the following: For the file 6-3-lines2.txt, the output should look like the following: Non-numeric data is found in the file. If you try to load a file name that does not exist, the output should look like the following: An error occurred while trying to read the file. 22189239054920497120025457 221892390549204971corn!57

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!