Skip to content
This repository was archived by the owner on Nov 3, 2020. It is now read-only.

Commit 1f2e1fb

Browse files
committed
3D calc
1 parent 4ac07e4 commit 1f2e1fb

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

ion05/3d-calc.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import math
2+
pie = 22/7
3+
fig = input("For which figure do you want to calculate ?")
4+
if fig == "Cube":
5+
s = float(input("Enter the length of the side"))
6+
type = input("What do you want to calculate")
7+
if type == "LSA":
8+
print(4*s*s)
9+
elif type == "TSA":
10+
print(6*s*s)
11+
elif type == "Volume":
12+
print(s**3)
13+
else:
14+
print("Invalid Type")
15+
elif fig == "Cuboid":
16+
l = float(input("Enter the Length"))
17+
w = float(input("Enter the width"))
18+
h = float(input("Enter the Height"))
19+
type = input("What do you want to c")
20+
if type == "LSA":
21+
a = 2((h*w)+(h*l))
22+
print(a)
23+
elif type == "TSA":
24+
print(2((h*w)+(h*l)+(l*w)))
25+
elif type == "Volume":
26+
print(l*w*h)
27+
else:
28+
print("Invalid Type")
29+
elif fig == "Sphere":
30+
r = float(input("Enter the radius"))
31+
type = input("What do you want to calculate ?")
32+
if type == "TSA":
33+
print(4*pie*r*r)
34+
elif type == "Volume":
35+
print((4*pie*r*r*r)/3)
36+
else:
37+
print("Invalid Type")
38+
39+

0 commit comments

Comments
 (0)