-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
117 lines (80 loc) · 2.31 KB
/
setup.py
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import math
import sys
while True:
print("#######################")
print(" ")
print("Calculate the Area's of different Shapes:")
print(" ")
print(" * * * * * * * * ")
s = print("1.Square")
re = print("2.Rectangle")
c = print("3.Circle")
tr = print("4.Triangle")
t = print("5.Trapezium")
r = print("6.Rhombus")
print(" * * * * * * * * ")
print(" ")
q = print("Press 'q' to exit the program!")
print(" ")
print("#######################")
s = 1
re = 2
c = 3
tr = 4
t = 5
r = 6
options = input("Choose an option: ")
if options == '1':
length = int(input("Enter length: "))
def squareArea(length):
area = length ** 2
return area
areaOfSquare = squareArea(length)
print("Area of Square :",areaOfSquare)
elif options == '2':
length = int(input("Enter length :"))
breadth = int(input("Enter breadth :"))
def rectangleArea(length, breadth):
area = length * breadth
return area
areaOfRect = rectangleArea(length, breadth)
print("Area of Rectangle :",areaOfRect)
elif options == '3':
radius = int(input("Enter radius :"))
def circleArea(radius):
pi = math.pi
area = pi * radius ** 2
return area
areaOfCir = circleArea(radius)
print("Area of Circle :",areaOfCir )
elif options == '4':
base = float(input("Enter base :"))
height = float(input("Enter height :"))
def triangleArea(base, height):
area = 0.5 * base * height
return area
areaOfTri = triangleArea(base, height)
print("Area of Triangle :",areaOfTri)
elif options == '5':
base1 = int(input("Enter base 1: "))
base2 = int(input("Enter base 2: "))
height = int(input("Enter height: "))
def trapeziumArea(base1, base2, height):
area = ((base1 + base2) / 2) * height
return area
areaOfTrap = trapeziumArea(base1, base2, height)
print("Area of Trapezium: ",areaOfTrap)
elif options == '6':
diagonal1 = int(input("Enter diagonal 1: "))
diagonal2 = int(input("Enter diagonal 2: "))
def rhombusArea(diagonal1, diagonal2):
area = (diagonal1 * diagonal2)/2
return area
areaOfRhom = rhombusArea(diagonal1, diagonal2)
print("Area of Rhombus: ",areaOfRhom)
elif options == 'q':
print("Thanks for using the program!")
sys.exit()
else:
print("Choose a proper option!!")
print("#######################")