mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
16 lines
355 B
Python
16 lines
355 B
Python
from .__init__ import *
|
|
|
|
|
|
def DecimalToBinaryFunc(max_dec=99):
|
|
a = random.randint(1, max_dec)
|
|
b = bin(a).replace("0b", "")
|
|
|
|
problem = "Binary of " + str(a) + "="
|
|
solution = str(b)
|
|
|
|
return problem, solution
|
|
|
|
|
|
decimal_to_binary = Generator("Decimal to Binary", 14, "Binary of a=", "b",
|
|
DecimalToBinaryFunc)
|