mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 14:35:23 +01:00
Added Quotient of Powers with Same Power number
This commit is contained in:
21
mathgenerator/funcs/quotientofpowersamepower.py
Normal file
21
mathgenerator/funcs/quotientofpowersamepower.py
Normal 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)
|
||||||
@@ -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)
|
celsiustofahrenheit = Generator("Celsius To Fahrenheit", 81, "(C +(9/5))+32=", "F", celsiustofahrenheitFunc)
|
||||||
quotientofpowersamebase = Generator("Quotient of Powers with Same Base", 82,
|
quotientofpowersamebase = Generator("Quotient of Powers with Same Base", 82,
|
||||||
"6^4 / 6^2 = 6^(4-2) = 6^2", "36", quotientofpowersamebaseFunc)
|
"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)
|
||||||
|
|||||||
Reference in New Issue
Block a user