Update mathgen.py

This commit is contained in:
Mohammed Mushahid Qureshi
2020-10-15 00:58:52 +05:30
committed by GitHub
parent c5ede58ba7
commit 8e2df67c1e

View File

@@ -40,7 +40,7 @@ def multiplicationFunc(maxRes = 99, maxMulti = 99):
i = int(1)
j = 0 #Indices for the loop
d = [] #Array to store the factors
while(i<=c): #Factors are less than or eqaul to the number
while(i<=c): #Factors are less than or equal to the number
if(c%i == 0): #If the remainder is 0, the number is a factor
d[j] = i #Store the factor
j += 1 #Move to the next index
@@ -96,4 +96,4 @@ multiplication = Generator("Multiplication", 4, "a*b=", "c", multiplicationFunc)
division = Generator("Division", 5, "a/b=", "c", divisionFunc)
binaryComplement1s = Generator("binary_complement_1s", 6, "1010=", "0101", binaryComplement1sFunc)
moduloDivision = Generator("Modulo_Division", 7, "a%b=", "c", moduloFunc)
squareRoot = Generator("Square _Root", 8, "sqrt(a)=", "b", squareRootFunction)
squareRoot = Generator("Square _Root", 8, "sqrt(a)=", "b", squareRootFunction)