Files
mathgenerator/mathgenerator/funcs/geometry/volume_sphere.py
2020-11-20 20:17:28 -05:00

16 lines
432 B
Python

from .__init__ import *
def volumeSphereFunc(maxRadius=100):
r = random.randint(1, maxRadius)
problem = f"Volume of sphere with radius {r} m = "
ans = (4 * math.pi / 3) * r * r * r
solution = f"{ans} m^3"
return problem, solution
volume_sphere = Generator("Volume of Sphere", 61,
"Volume of sphere with radius r m = ",
"(4*pi/3)*r*r*r", volumeSphereFunc)