Files
stuff/old/activity-deep.py

20 lines
405 B
Python
Raw Permalink Normal View History

2026-02-20 11:42:22 +11:00
# 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)