Added Python version using recursion