Files
mathgenerator/mathgenerator/funcs/binaryToHexFunc.py
2020-10-19 13:54:31 -04:00

12 lines
255 B
Python

from .__init__ import *
def binaryToHexFunc(max_dig=10):
problem = ''
for i in range(random.randint(1, max_dig)):
temp = str(random.randint(0, 1))
problem += temp
solution = hex(int(problem, 2))
return problem, solution