mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 14:35:23 +01:00
linter fix
This commit is contained in:
@@ -38,10 +38,9 @@ def complexQuadraticFunc(prob_type=0, max_range=10):
|
|||||||
|
|
||||||
eq += str(c) + ' = 0'
|
eq += str(c) + ' = 0'
|
||||||
|
|
||||||
problem = f'Find the roots of given Quadratic Equation ' + eq
|
problem = 'Find the roots of given Quadratic Equation ' + eq
|
||||||
|
|
||||||
if d < 0:
|
if d < 0:
|
||||||
roots = ''
|
|
||||||
sqrt_d = (-d)**0.5
|
sqrt_d = (-d)**0.5
|
||||||
|
|
||||||
if sqrt_d - int(sqrt_d) == 0:
|
if sqrt_d - int(sqrt_d) == 0:
|
||||||
|
|||||||
@@ -25,8 +25,7 @@ def decimalToRomanNumeralsFunc(maxDecimal=4000):
|
|||||||
elif last_value == 4:
|
elif last_value == 4:
|
||||||
solution += (roman_dict[divisor] + roman_dict[divisor * 5])
|
solution += (roman_dict[divisor] + roman_dict[divisor * 5])
|
||||||
elif 5 <= last_value <= 8:
|
elif 5 <= last_value <= 8:
|
||||||
solution += (roman_dict[divisor * 5] + (roman_dict[divisor] *
|
solution += (roman_dict[divisor * 5] + (roman_dict[divisor] * (last_value - 5)))
|
||||||
(last_value - 5)))
|
|
||||||
elif last_value == 9:
|
elif last_value == 9:
|
||||||
solution += (roman_dict[divisor] + roman_dict[divisor * 10])
|
solution += (roman_dict[divisor] + roman_dict[divisor * 10])
|
||||||
x = math.floor(x % divisor)
|
x = math.floor(x % divisor)
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ def nthFibonacciNumberFunc(maxN=100):
|
|||||||
golden_ratio = (1 + math.sqrt(5)) / 2
|
golden_ratio = (1 + math.sqrt(5)) / 2
|
||||||
n = random.randint(1, maxN)
|
n = random.randint(1, maxN)
|
||||||
problem = f"What is the {n}th Fibonacci number?"
|
problem = f"What is the {n}th Fibonacci number?"
|
||||||
ans = round((math.pow(golden_ratio, n) - math.pow(-golden_ratio, -n)) /
|
ans = round((math.pow(golden_ratio, n) - math.pow(-golden_ratio, -n)) / (math.sqrt(5)))
|
||||||
(math.sqrt(5)))
|
|
||||||
solution = f"{ans}"
|
solution = f"{ans}"
|
||||||
return problem, solution
|
return problem, solution
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user