mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 14:35:23 +01:00
Move files to subject folders
This commit is contained in:
15
mathgenerator/funcs/computer_science/decimal_to_binary.py
Normal file
15
mathgenerator/funcs/computer_science/decimal_to_binary.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from .__init__ import *
|
||||
|
||||
|
||||
def DecimalToBinaryFunc(max_dec=99):
|
||||
a = random.randint(1, max_dec)
|
||||
b = bin(a).replace("0b", "")
|
||||
|
||||
problem = "Binary of " + str(a) + "="
|
||||
solution = str(b)
|
||||
|
||||
return problem, solution
|
||||
|
||||
|
||||
decimal_to_binary = Generator("Decimal to Binary", 14, "Binary of a=", "b",
|
||||
DecimalToBinaryFunc)
|
||||
Reference in New Issue
Block a user