diff --git a/mathgenerator/funcs/binary2sComplement.py b/mathgenerator/funcs/binary2sComplement.py index 478b2c9..01af731 100644 --- a/mathgenerator/funcs/binary2sComplement.py +++ b/mathgenerator/funcs/binary2sComplement.py @@ -20,7 +20,7 @@ def binary2sComplementFunc(maxDigits=10): answer[j] = '0' j -= 1 - if j == 0 and carry == True: + if j == 0 and carry is True: answer.insert(0, '1') problem = "2's complement of " + question + " =" diff --git a/mathgenerator/funcs/fibonacciSeriesFunc.py b/mathgenerator/funcs/fibonacciSeriesFunc.py index a66e2f4..60391cb 100644 --- a/mathgenerator/funcs/fibonacciSeriesFunc.py +++ b/mathgenerator/funcs/fibonacciSeriesFunc.py @@ -5,14 +5,14 @@ def fibonacciSeriesFunc(minNo=1): n = random.randint(minNo, 20) def createFibList(n): - l = [] + list = [] for i in range(n): if i < 2: - l.append(i) + list.append(i) else: - val = l[i - 1] + l[i - 2] - l.append(val) - return l + val = list[i - 1] + list[i - 2] + list.append(val) + return list fibList = createFibList(n) diff --git a/mathgenerator/funcs/nthFibonacciNumberFunc.py b/mathgenerator/funcs/nthFibonacciNumberFunc.py index a1a66fb..b7475ee 100644 --- a/mathgenerator/funcs/nthFibonacciNumberFunc.py +++ b/mathgenerator/funcs/nthFibonacciNumberFunc.py @@ -5,7 +5,6 @@ def nthFibonacciNumberFunc(maxN=100): golden_ratio = (1 + math.sqrt(5)) / 2 n = random.randint(1, maxN) problem = f"What is the {n}th Fibonacci number?" - ans = round((math.pow(golden_ratio, n) - math.pow(-golden_ratio, -n)) / - (math.sqrt(5))) + ans = round((math.pow(golden_ratio, n) - math.pow(-golden_ratio, -n)) / (math.sqrt(5))) solution = f"{ans}" return problem, solution diff --git a/mathgenerator/mathgen.py b/mathgenerator/mathgen.py index a9b2a98..faa6cac 100644 --- a/mathgenerator/mathgen.py +++ b/mathgenerator/mathgen.py @@ -40,7 +40,7 @@ def genById(id): # Format is: #