mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2026-06-02 13:28:10 +02:00
Create binaryToHexaFunction.py
Binary to Hexadecimal conversion function file
This commit is contained in:
@@ -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
|
||||||
Reference in New Issue
Block a user