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

19 lines
465 B
Python

from .__init__ import *
def volumeCube(maxSide=20, unit='m', format='string'):
a = random.randint(1, maxSide)
ans = a ** 3
if format == 'string':
problem = f"Volume of cube with side = {a}{unit} is"
solution = f"{ans} {unit}^3"
return problem, solution
else:
return a, ans, unit
volume_cube = Generator("Volum of Cube", 35,
volumeCube,
["maxSide=20", "unit='m'"])