mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 14:35:23 +01:00
renamed modules and generators to fit pep8
This commit is contained in:
15
mathgenerator/funcs/log.py
Normal file
15
mathgenerator/funcs/log.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from .__init__ import *
|
||||
|
||||
|
||||
def logFunc(maxBase=3, maxVal=8):
|
||||
a = random.randint(1, maxVal)
|
||||
b = random.randint(2, maxBase)
|
||||
c = pow(b, a)
|
||||
|
||||
problem = "log" + str(b) + "(" + str(c) + ")"
|
||||
solution = str(a)
|
||||
|
||||
return problem, solution
|
||||
|
||||
|
||||
log = Generator("Logarithm", 12, "log2(8)", "3", logFunc)
|
||||
Reference in New Issue
Block a user