mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 14:35:23 +01:00
fix #242
This commit is contained in:
11
mathgenerator/funcs/DecimalToHexFunc.py
Normal file
11
mathgenerator/funcs/DecimalToHexFunc.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
from .__init__ import *
|
||||||
|
|
||||||
|
|
||||||
|
def DecimalToHexFunc(max_dec=99):
|
||||||
|
a = random.randint(1, max_dec)
|
||||||
|
b = hex(a).replace("0x", "")
|
||||||
|
|
||||||
|
problem = "Hexadecimal of " + str(a) + "="
|
||||||
|
solution = str(b)
|
||||||
|
|
||||||
|
return problem, solution
|
||||||
@@ -156,3 +156,5 @@ complexNumMultiply = Generator("Multiplication of 2 complex numbers", 64, "(x +
|
|||||||
geometricprogression=Generator("Geometric Progression", 65, "Initial value,Common Ratio,nth Term,Sum till nth term =", "a,r,ar^n-1,sum(ar^n-1", geomProgrFunc)
|
geometricprogression=Generator("Geometric Progression", 65, "Initial value,Common Ratio,nth Term,Sum till nth term =", "a,r,ar^n-1,sum(ar^n-1", geomProgrFunc)
|
||||||
geometricMean=Generator("Geometric Mean of N Numbers",66,"Geometric mean of n numbers A1 , A2 , ... , An = ","(A1*A2*...An)^(1/n) = ans",geometricMeanFunc)
|
geometricMean=Generator("Geometric Mean of N Numbers",66,"Geometric mean of n numbers A1 , A2 , ... , An = ","(A1*A2*...An)^(1/n) = ans",geometricMeanFunc)
|
||||||
harmonicMean=Generator("Harmonic Mean of N Numbers",67,"Harmonic mean of n numbers A1 , A2 , ... , An = "," n/((1/A1) + (1/A2) + ... + (1/An)) = ans",harmonicMeanFunc)
|
harmonicMean=Generator("Harmonic Mean of N Numbers",67,"Harmonic mean of n numbers A1 , A2 , ... , An = "," n/((1/A1) + (1/A2) + ... + (1/An)) = ans",harmonicMeanFunc)
|
||||||
|
decimalToHexadecimal = Generator("Decimal to Hexadecimal", 68,
|
||||||
|
"Hexadecimal of a=", "b", DecimalToHexFunc)
|
||||||
Reference in New Issue
Block a user