-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpracties.py
More file actions
34 lines (25 loc) · 724 Bytes
/
practies.py
File metadata and controls
34 lines (25 loc) · 724 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
29
30
#Find triangle Area
def value(a,b):
area = (a*b)*0.5
return area
#user enter the values one by one
area = value(int(input("enter the height :")),int(input("enter the base :")))
print("the triangle area is ",area)
#find rectangle peremeter
def rectangle(l,w):
peremeter = 2*(l+w)
return peremeter
peremeter = rectangle(int(input("enter the length :")),int(input("enter the width :")))
print("rectangle peremeter is ",peremeter)
import sys
li = ['a', 0, 2]
for i in li:
try:
print("the entery is", i)
r = 1 / int(i)
break
except:
print("oops!", sys.exc_info()[0], "occurred.")
print("next entery")
print()
print("the reciprocal of" ,i ,"is" ,r)