Added Quotient of Powers with Same Power number

This commit is contained in:
Nitsujed
2020-10-19 15:10:32 -04:00
parent 804ef68f6c
commit 1844fb3447
2 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
from .__init__ import *
from ..__init__ import Generator
def quotientofpowersamepowerFunc(maxBase=50, maxPower=10):
base1 = random.randint(1, maxBase)
base2 = random.randint(1, maxBase)
power = random.randint(1, maxPower)
step = base1/base2
problem = "The Quotient of {base1}^{power} and {base2}^{power} = " \
"({base1}/{base2})^{power} = {step}^{power}".format(base1=base1,
base2=base2,
power=power,
step=step)
solution = str(step**power)
return problem, solution
quotientofpowersamepower = Generator("Quotient of Powers with Same Power", 83,
"6^4 / 3^4 = (6/3)^4 = 2^4", "16", quotientofpowersamepowerFunc)

View File

@@ -270,3 +270,5 @@ percentage = Generator("Percentage of a number", 80, "What is a% of b?",
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)
quotientofpowersamepower = Generator("Quotient of Powers with Same Power", 83,
"6^4 / 3^4 = (6/3)^4 = 2^4", "16", quotientofpowersamepowerFunc)