Files
stuff/old/activity-deep.py
Maxwell Jeffress 3fdb90a652 Stuff
2026-02-20 11:42:22 +11:00

20 lines
405 B
Python

# 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)