mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 14:35:23 +01:00
16 lines
390 B
Python
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)
|