-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtry.py
More file actions
29 lines (24 loc) · 715 Bytes
/
try.py
File metadata and controls
29 lines (24 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# success = False
# while success == False:
#
# try :
# radius = int(input("enter radius r : "))
# area = 3.14*(radius)**2
# print(area)
# success = True
# except:
# print("invalid value for radius")
#crate a function divided with two parameter a,b
#now it should return the divided value like a/b,
#now if the input form the user ie. b = 0 , our program should produce a nice exception error,
def d(a,b):
print(a/b)
success = False
while success == False:
try:
a = int(input("enter a num : "))
b = int(input("enter a num : "))
d(a,b)
success = True
except:
print("f*** wrong num")