Stuff
This commit is contained in:
19
old/activity-deep.py
Normal file
19
old/activity-deep.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Created by Maxwell Jeffress on 11/02/2026.
|
||||
# Calculates the volume of a cube, square based pyramid, and cylinder.
|
||||
|
||||
import math
|
||||
|
||||
width = 0
|
||||
|
||||
try:
|
||||
width = int(input("Width: "))
|
||||
except ValueError:
|
||||
print("Invalid input!")
|
||||
exit(1)
|
||||
|
||||
|
||||
cubeSize = width ^^ 3
|
||||
print("Cube volume is", cubeSize)
|
||||
|
||||
cylinder = ( math.pi * (width / 2) ^^ 2 * width )
|
||||
print("Cylinder volume is", cylinder)
|
||||
Reference in New Issue
Block a user