-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcalAreaRectangle.py
More file actions
33 lines (30 loc) · 1018 Bytes
/
calAreaRectangle.py
File metadata and controls
33 lines (30 loc) · 1018 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
#P2. WAP to print area of rectangle taking length & breadth of rectangle as user input.
def areaRectangle(length, breadth):
'''
Objective : To compute the area of a rectangle
Input Parameters :
length : length of rectangle
breadth : breadth of rectangle
Return Value : Area of rectangle
'''
#approach : multiply length and breadth
area = length*breadth
return area
def main():
'''
Objective : To compute the area of a rectangle
User Inputs :
length : length of rectangle
breadth : breadth of rectangle
Return Value : None
'''
#approach: use function areaRectangle
length = int(input('Enter Length of Rectangle: '))
breadth = int(input('Enter Breadth of Rectangle: '))
print('Length of Rectangle: ', length)
print('Breadth of Rectangle: ', breadth)
print('Area of Rectangle: ', areaRectangle(length, breadth))
print('End of Output')
if __name__ == '__main__':
main()
print('Program Ends..!')