diff --git a/mathgenerator/funcs/binaryToHexaFunction.py b/mathgenerator/funcs/binaryToHexaFunction.py new file mode 100644 index 0000000..e40f775 --- /dev/null +++ b/mathgenerator/funcs/binaryToHexaFunction.py @@ -0,0 +1,11 @@ +from .__init__ import * + + +def binaryToHexaFunc(max_dig=1000): + problem = '' + for i in range(random.randint(1, max_dig)): + temp = str(random.randint(0, 1)) + problem += temp + + solution = hex(int(problem)) + return problem, solution