Files
mathgenerator/mathgenerator/funcs/geometry/surface_area_sphere.py
2021-10-06 02:22:32 -04:00

20 lines
484 B
Python

from .__init__ import *
def surfaceAreaSphere(maxSide=20, unit='m', format='string'):
r = random.randint(1, maxSide)
ans = 4 * math.pi * r * r
if format == 'string':
problem = f"Surface area of Sphere with radius = {r}{unit} is"
solution = f"{ans} {unit}^2"
return problem, solution
else:
return r, ans, unit
surface_area_sphere = Generator(
"Surface Area of Sphere", 60,
surfaceAreaSphere,
["maxSide=20", "unit='m'"])