My task is to define a procedure is_palindrome, that takes as input a string, and returns a boolean indicating if the input string is a palindrome. In this case a single let
is_palindrome(s[1:len(s)-1])
needs to be...
return is_palindrome(s[1:len(s)-1])
in your first version, or
result = is_palindrome(s[1:len(s)-1])
in your second. Otherwise, you never actually propagate the recursive call's return value back to the original caller.