Why does my function think that "uiouioiu"is a plaindrome? I was reading Introduction to Computation and Programming using Python and there in an exercise, we had to write a function which would tell us if a given word is a palindrome or not, recursively. 

This is the code which I wrote:

word = input()

def isPalindrome(x):
    if len(x) &gt; 1:
        if x[0] == x[-1] and isPalindrome(x[1:-1]):
            return('The word is Plaindrome.')
        else:
            return('It is not.')
    else:
        return(True) #As this is a base case.


print(isPalindrome(word))


This seems to work for all the words I pass into it except uiouioiu.
isPalindrome(uiouioiu) returns The word is Palindrome.

Could someone explain what is happening?

EDIT 1: If I modify the code to:

word = input()

def isPalindrome(x):
    if len(x) &gt; 1:
        if x[0] == x[-1] and isPalindrome(x[1:-1]):
            return(True)
        else:
            return(False)
    else:
        return(True) #As this is a base case.


print(isPalindrome(word))


isPalindrome(uiouioiu) returns False as expected. Why is this happening?
The reason it doesn't work is that "It is not" is converted into True, so when you analyze 
"uiouioiu" the process eventually has to check the middle part "ui", the problem is that the answer "It is not" is then interpreted as True.

The same behaviour should also be obtained when testing the word "abca"