Files
mathgenerator/mathgenerator/funcs/decimalToOctalFunc.py
2020-10-19 21:19:32 -04:00

12 lines
353 B
Python

from .__init__ import *
def decimalToOctalFunc(maxDecimal=4096):
x = random.randint(0, maxDecimal)
problem = "The decimal number " + str(x) + " in Octal is: "
solution = oct(x)
return problem, solution
decimalToOctal = Generator("Converts decimal to octal", 82, "What's the octal representation of 98?", "0o142", decimalToOctalFunc)