mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 14:35:23 +01:00
13 lines
268 B
Python
13 lines
268 B
Python
from .__init__ import *
|
|
|
|
|
|
def BinaryToDecimalFunc(max_dig=10):
|
|
problem = ''
|
|
|
|
for i in range(random.randint(1, max_dig)):
|
|
temp = str(random.randint(0, 1))
|
|
problem += temp
|
|
|
|
solution = int(problem, 2)
|
|
return problem, solution
|