From 65a56b69156415b28cd4fab77e786ef925be61f1 Mon Sep 17 00:00:00 2001 From: helplessThor <66440538+helplessThor@users.noreply.github.com> Date: Mon, 19 Oct 2020 20:23:11 +0530 Subject: [PATCH] Create deciToHexaFunc.py --- mathgenerator/funcs/deciToHexaFunc.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 mathgenerator/funcs/deciToHexaFunc.py diff --git a/mathgenerator/funcs/deciToHexaFunc.py b/mathgenerator/funcs/deciToHexaFunc.py new file mode 100644 index 0000000..a815e34 --- /dev/null +++ b/mathgenerator/funcs/deciToHexaFunc.py @@ -0,0 +1,10 @@ +from .__init__ import * + + +def deciToHexaFunc(max_dec=1000): + a = random.randint(0, max_dec) + b = hex(a) + problem = "Binary of " + str(a) + "=" + solution = str(b) + + return problem, solution