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
In your first example, you forgot a return statement:
def is_palindrome(s):
if s == '':
return True
else:
if (ord(s[0]) - ord(s[len(s)-1])) == 0:
# v-- forgot this here
return is_palindrome(s[1:len(s)-1])
else:
return False