Python program to print inbuilt exception statement while type of exception is occurred
belongs to collection: Python Exception Handling Programs
All Answers
total answers (1)
belongs to collection: Python Exception Handling Programs
total answers (1)
Program:
Output:
Explanation:
In the above code, we have created two variables num1 and num2 and taken user input for their values. Both the values entered need to be integer values only. And then we have printed their sum. If the user enters any value other than integer, an exception occurs which is handled using an except block that prints an in-build exception statement.
need an explanation for this answer? contact us directly to get an explanation for this answer