We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
0 parents commit 6e2e753Copy full SHA for 6e2e753
ExceptionHandling.py
@@ -0,0 +1,19 @@
1
+#Exception Handling using try and except
2
+
3
+try:
4
+ print(10/0)
5
+except ZeroDivisionError:
6
+ print("Denominator should not be Zero")
7
8
+#Exception Handling using try with multiple except block
9
+#Here if exception raised in try block then it search for matching except block from top to down manner
10
11
+ x=int(input("Enter value of x:"))
12
+ y=int(input("Enter value of y:"))
13
+ print("The Division is:",x/y)
14
+except ArithmeticError:
15
+ print("ArithmeticError:The Denominator value should not be zero")
16
+except ValueError:
17
+ print("ValueError: The value must be integral value")
18
19
+ print("ZeroDivisionError: The Denominator value should not be zero")
0 commit comments