Files
mathgenerator/mathgenerator/funcs/exponentiationFunc.py
2020-10-19 19:33:00 +05:30

11 lines
253 B
Python

from .__init__ import *
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