@BlueBowser/

# AreaCalculator

## No description

Files
• main.py
main.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
import math

while True:
mode = input('Choose shape:\ntriangle\nrectangle\nsquare\ncircle\ntrapezoid\n\nType \'break\' to stop.\n')
if mode == 'break':
break

if mode == 'triangle':
b = float(input('Please enter base (cm): '))
h = float(input('Please enter height (cm): '))
ans = (b*h)/2
print('The area is {} cm.\n\n\n '.format(str(ans)))

if mode == 'rectangle':
b = float(input('Please enter base (cm): '))
h = float(input('Please enter height (cm): '))
ans = (b*h)
print('The area is {} cm.\n\n\n '.format(str(ans)))

if mode == 'trapezoid':
b = float(input('Please enter base (cm): '))
b2 = float(input('Please enter second base (cm)'))
h = float(input('Please enter height (cm): '))
ans = 0.5*(b + b2)*h
print('The area is {} cm.\n\n\n '.format(str(ans)))

if mode == 'square':
s = float(input('Please enter side length (cm): '))
ans = s**2
print('The area is {} cm.\n\n\n '.format(str(ans)))

if mode == 'circle':