linter fix

This commit is contained in:
lukew3
2020-10-19 14:14:08 -04:00
parent 90a794cc05
commit 4f03d1b035
4 changed files with 8 additions and 9 deletions

View File

@@ -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 + " ="

View File

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

View File

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