forked from deepakmca17du/python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharea.py
More file actions
35 lines (32 loc) · 942 Bytes
/
area.py
File metadata and controls
35 lines (32 loc) · 942 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
31
32
33
34
35
def areaRectangle(length,breadth):
'''
objective: to compute the area of rectangle
input parameters:
length: length of rectangle
breadth: breadth of rectangle
approach: multiply length and breadth
return value: area of rectangle
'''
area=length*breadth
return area
def areaSquare(side):
'''
objective: to compute the area of a square
input parameters:
side: side of the square
approach: to invoke the function areaRectangle with
side as length and breadth
return value: area of square
'''
return areaRectangle(side,side)
def areaTriangle(base, height):
'''
objective:to compute the area of Triangle
input parameters:
base: base of Triangle
height: height of triangle
approach: multiply base and height and divide it by 2
return value: area of triangle
'''
area = base*height/2
return area