Files
mathgenerator/mathgenerator/funcs/exponentiationFunc.py
2020-10-19 20:33:18 -04:00

16 lines
390 B
Python

from .__init__ import *
from ..__init__ import Generator
def exponentiationFunc(maxBase=20, maxExpo=10):
base = random.randint(1, maxBase)
expo = random.randint(1, maxExpo)
problem = f"{base}^{expo} ="
solution = str(base**expo)
return problem, solution
exponentiation = Generator("Exponentiation", 53, "a^b = ", "c",
exponentiationFunc)