mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-03-04 22:58:46 +00:00
Polish fibonacci challenge and solution (#91)
Update constraints, test cases, tests, and code.
This commit is contained in:
@@ -5,10 +5,10 @@ class TestFib(object):
|
||||
|
||||
def test_fib(self, func):
|
||||
result = []
|
||||
for i in range(num_items):
|
||||
expected = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
|
||||
for i in range(len(expected)):
|
||||
result.append(func(i))
|
||||
fib_seq = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
|
||||
assert_equal(result, fib_seq)
|
||||
assert_equal(result, expected)
|
||||
print('Success: test_fib')
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user