code for discerning palindromes
<pre><code>def is_palindrome(s):

    if s == ' ':
        return True

    if s[0] != s[-1]:
        return False

    return is_palindrome(s[1:-1])
</code></pre>

<p>This is my code and it doesn't work.
It works for cases such as abab, but not abba.
Can anyone tell me why?</p>
