Added Quotient of Powers with Same Base number

This commit is contained in:
Nitsujed
2020-10-19 15:02:50 -04:00
parent 464478676a
commit 804ef68f6c
2 changed files with 23 additions and 0 deletions

View 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)

View File

@@ -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)