Пример #1
0
 def test_fib_6(self):
     self.assertEqual(fibonacci(6), 8)
     self.assertEqual(dynamic_fibonacci(6, lookup=[None] * 101), 8)
Пример #2
0
 def test_fib_max(self):
     self.assertEqual(fibonacci(34), 5702887)
     self.assertEqual(dynamic_fibonacci(99, lookup=[None] * 101),
                      218922995834555169026)
Пример #3
0
 def test_fib_5(self):
     self.assertEqual(fibonacci(5), 5)
     self.assertEqual(dynamic_fibonacci(5, lookup=[None] * 101), 5)
Пример #4
0
 def test_fib_4(self):
     self.assertEqual(fibonacci(4), 3)
     self.assertEqual(dynamic_fibonacci(4, lookup=[None] * 101), 3)
Пример #5
0
 def test_fib_3(self):
     self.assertEqual(fibonacci(3), 2)
     self.assertEqual(dynamic_fibonacci(3, lookup=[None] * 101), 2)
Пример #6
0
 def test_fib_2(self):
     self.assertEqual(fibonacci(2), 1)
     self.assertEqual(dynamic_fibonacci(2, lookup=[None] * 101), 1)
Пример #7
0
 def test_fib_0(self):
     self.assertEqual(fibonacci(0), 0)
     self.assertEqual(dynamic_fibonacci(0, lookup=[None] * 101), 0)