mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
17 lines
462 B
Python
17 lines
462 B
Python
from .__init__ import *
|
|
from ..__init__ import Generator
|
|
|
|
|
|
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
|
|
|
|
|
|
volumeSphere = Generator("Volume of Sphere", 61,
|
|
"Volume of sphere with radius r m = ",
|
|
"(4*pi/3)*r*r*r", volumeSphereFunc)
|