Merge pull request #248 from helplessThor/helplessThor-deci-hex

Decimal To Hexadeci function
This commit is contained in:
Luke Weiler
2020-10-19 11:06:34 -04:00
committed by GitHub
3 changed files with 12 additions and 0 deletions

View File

@@ -80,3 +80,4 @@ from .matrixInversion import *
from .sectorAreaFunc import*
from .meanMedianFunc import*
from .determinantToMatrix22 import *
from .deciToHexaFunc import *

View File

@@ -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

View File

@@ -113,3 +113,4 @@ sectorArea=Generator("Area of a Sector", 75,"Area of a sector with radius, r and
meanMedian=Generator("Mean and Median", 76,"Mean and median of given set of numbers","Mean, Median",meanMedianFunc)
intMatrix22determinant = Generator("Determinant to 2x2 Matrix", 77, "Det([[a,b],[c,d]]) =", " a * d - b * c", determinantToMatrix22)
compoundInterest = Generator("Compound Interest", 78, "Compound interest for a principle amount of p dollars, r% rate of interest and for a time period of t years with n times compounded annually is = ", "A dollars", compoundInterestFunc)
decimalToHexadeci = Generator("Decimal to Hexadecimal", 79,"Binary of a=", "b", deciToHexaFunc)