-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1. Q 17,18.py
More file actions
28 lines (25 loc) · 798 Bytes
/
1. Q 17,18.py
File metadata and controls
28 lines (25 loc) · 798 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
#Calculate area & perimeter of a square. A = L^2, P = 4L
# Calculate area & perimeter of a rectangle. A = L*B, P = 2 (L+B)
#question 17 and 18
def area_sq():
s=int(input("enter the side of square"))
area=s*s
print("the area of sqaure is :",area)
area_sq()
def perimeter_sq():
s=int(input("enter the value of side of square"))
perimeter= 4*s
print("perimeter=",perimeter)
perimeter_sq()
def area_rectangle():
l=int(input("enter the length"))
b=int(input("enter the breadth"))
area=b*l
print("the area of rectangle is :",area)
area_rectangle()
def perimeter_rectangle():
l=int(input("enter the length"))
b=int(input("enter the breadth"))
perimeter= 2*(l+b)
print("perimeter=",perimeter)
perimeter_rectangle()