Skip to content

Commit 2cc3f0b

Browse files
authored
Final QA (#552)
1 parent eaedcbd commit 2cc3f0b

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

python-built-in-functions/fibonacci.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
class Fibonacci:
2-
def __init__(self):
3-
self._cache = [0, 1]
1+
class Fibonaccish:
2+
def __init__(self, initial_value=1):
3+
self._cache = [0, initial_value]
44

55
def __call__(self, index):
66
if index < len(self._cache):
77
fib_number = self._cache[index]
8-
print(f"{fib_number} id = {id(fib_number)}")
8+
print(f"{index} {fib_number} id = {id(fib_number)}")
99
else:
1010
fib_number = self(index - 1) + self(index - 2)
1111
self._cache.append(fib_number)

python-built-in-functions/progress.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
def progress(percent=0, width=30):
2-
end = ""
3-
if percent == 100:
4-
end = "\n"
2+
end = "" if percent < 100 else "\n"
53
left = width * percent // 100
64
right = width - left
75
print(

0 commit comments

Comments
 (0)