Skip to content

Commit 8f58b38

Browse files
exception handling------
1 parent 07f2ae3 commit 8f58b38

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

exception.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# exception handling---------
2+
3+
# mostly these thing we uses at that time like when user have a problem of internet connectivity
4+
#so there we will use this for printing the error
5+
6+
7+
print("Enter num 1")
8+
num1 = input ()
9+
# num1 = int(input())
10+
print("Enter num 2")
11+
num2 = input ()
12+
#num2 = int(input())
13+
try:
14+
print("The sum of these two numbers is",
15+
int(num1) + int(num2))
16+
except Exception as e:
17+
print(e)
18+
19+
print("this line is very imporatnt")

0 commit comments

Comments
 (0)