mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 14:35:23 +01:00
Added Quotient of Powers with Same Base number
This commit is contained in:
21
mathgenerator/funcs/quotientofpowersamebase.py
Normal file
21
mathgenerator/funcs/quotientofpowersamebase.py
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
from .__init__ import *
|
||||||
|
from ..__init__ import Generator
|
||||||
|
|
||||||
|
|
||||||
|
def quotientofpowersamebaseFunc(maxBase=50, maxPower=10):
|
||||||
|
base = random.randint(1, maxBase)
|
||||||
|
power1 = random.randint(1, maxPower)
|
||||||
|
power2 = random.randint(1, maxPower)
|
||||||
|
step = power1 - power2
|
||||||
|
|
||||||
|
problem = "The Quotient of {base}^{power1} and {base}^{power2} = " \
|
||||||
|
"{base}^({power1}-{power2}) = {base}^{step}".format(base=base,
|
||||||
|
power1=power1,
|
||||||
|
power2=power2,
|
||||||
|
step=step)
|
||||||
|
solution = str(base**step)
|
||||||
|
return problem, solution
|
||||||
|
|
||||||
|
|
||||||
|
quotientofpowersamebase = Generator("Quotient of Powers with Same Base", 82,
|
||||||
|
"6^4 / 6^2 = 6^(4-2) = 6^2", "36", quotientofpowersamebaseFunc)
|
||||||
@@ -268,3 +268,5 @@ decimalToHexadeci = Generator("Decimal to Hexadecimal", 79, "Binary of a=",
|
|||||||
percentage = Generator("Percentage of a number", 80, "What is a% of b?",
|
percentage = Generator("Percentage of a number", 80, "What is a% of b?",
|
||||||
"percentage", percentageFunc)
|
"percentage", percentageFunc)
|
||||||
celsiustofahrenheit = Generator("Celsius To Fahrenheit", 81, "(C +(9/5))+32=", "F", celsiustofahrenheitFunc)
|
celsiustofahrenheit = Generator("Celsius To Fahrenheit", 81, "(C +(9/5))+32=", "F", celsiustofahrenheitFunc)
|
||||||
|
quotientofpowersamebase = Generator("Quotient of Powers with Same Base", 82,
|
||||||
|
"6^4 / 6^2 = 6^(4-2) = 6^2", "36", quotientofpowersamebaseFunc)
|
||||||
|
|||||||
Reference in New Issue
Block a user