From 4a640b436bae8824b3825139edc1cd052b55ba7a Mon Sep 17 00:00:00 2001 From: Vedant Gautam Date: Thu, 3 Jun 2021 22:05:06 +0530 Subject: [PATCH] added docktest --- .../Python/dynamic_programming/catalan_sequence.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/algorithms/Python/dynamic_programming/catalan_sequence.py b/algorithms/Python/dynamic_programming/catalan_sequence.py index b70188dc..01f19436 100644 --- a/algorithms/Python/dynamic_programming/catalan_sequence.py +++ b/algorithms/Python/dynamic_programming/catalan_sequence.py @@ -9,6 +9,16 @@ The first 10 terms of Catalan sequence are : def catalan(n): + """ + >>> catalan(2) + 2 + >>> catalan(5) + 42 + >>> catalan(-1) + Traceback (most recent call last): + ... + IndexError: list assignment index out of range + """ # Base Case if n == 0 or n == 1: return 1