def test_fibonacci_number(self): self.assertEqual(fibonacci(0), 0) self.assertEquals(fibonacci(1), 1) self.assertEquals(fibonacci(2), 1) self.assertEquals(fibonacci(3), 2) self.assertEquals(fibonacci(4), 3) self.assertEquals(fibonacci(5), 5) self.assertEquals(fibonacci(6), 8) self.assertEquals(fibonacci(100), 354224848179261915075)
def problem25(): i = 1 for f in fibonacci(): if len(str(f)) >= 1000: return i i += 1
def test_problem2_large(self): result = problem2.fibonacci(4000000) self.assertEqual(result, 4613732)
def test_problem2_small(self): result = problem2.fibonacci(90) self.assertEqual(result, 44)