Step to create the exception file which will define type exception:
- Step 1: Define the method for exception.
- Step 2: Check for the input, if current input is of specific type no exception is there.
- Step 3: Else, print exception.
Creating the main file
- Step 1: Import the exception file.
- Step 2: Call the method and check the exception and return the expectation based on the imported function.
- Step 3: Here, we also need to check if enter marks are not in the range or not.
- Step 4: Return the result as required.
Program:
ExceptionLib.py
main.py
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer