Assignment Need Add Exception Handling Given Code File Provided Consists Basic Template Ne Q37047547

In this assignment, you need to add exception handling to thegiven code.

The file provided consists of a basic template, you need toinclude try- except statements at the correct positions, so thatyour program will not terminate returning an error.

The objective of this program is to read two integers from theinput and perform a division operation on them, and lastly writethe result to a file.

Your task is to handle incorrect inputs (like strings)(ValueError), dividing by zero (ZeroDivisionError) and givingincorrect filename (IOError) as the input.

You need to do the following:

  1. Include try at the appropriate position.
  2. Add except statements, one for each of these exceptions(ValueError,
    OR
    OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.