mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
20 lines
484 B
Python
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'"])
|