Python palindrome program I have written a palindrome program. And I was just wondering if it correct? I checked using the words racecar and madam, and it says they are palindromes. I have also tested nonpalindrome words and it worked correctly.

Is my implementation correct? If it's not could you correct it for me. It it works correct, is there an easier way to implement this?

def is_palindrome(x):

    for i in range(0,len(x)):
        x = x.lower()
        if x[i::1] == x[::-1]:
            return("%s Is a palindrome" %(x))
        else:
            return("%s Is not a palindrome" %(x))

print(is_palindrome('racecar'))
I would expect a function that has a &quot;predicate&quot; name (is_x()) to return a boolean value rather than a string.  The boolean is much more useful to the caller.
We should add a main-guard to top-level code, so the file could be useful as a module.
Consider adding some unit tests.  A convenient way to do this is using the doctest module, which finds tests in the function's docstring; any line beginning with &gt;&gt;&gt; is a test, and is immediately followed by the expected result.
Building on the version shown by C.Nivs, that would give this improved version:
def is_palindrome(x):
    '''
    True if the letters of x are the same when
    reversed, ignoring differences of case.
    &gt;&gt;&gt; is_palindrome('')
    True
    &gt;&gt;&gt; is_palindrome('a')
    True
    &gt;&gt;&gt; is_palindrome('a0')
    False
    &gt;&gt;&gt; is_palindrome('ab')
    False
    &gt;&gt;&gt; is_palindrome('ab a')
    False
    &gt;&gt;&gt; is_palindrome('Aba')
    True
    &gt;&gt;&gt; is_palindrome('Àbà')
    True
    '''
    x = x.lower()
    # Alternative (letters only):
    #     x = ''.join(filter(str.isalpha, x.lower()))
    # Alternative (letters and digits only):
    #     x = ''.join(filter(str.isalnum x.lower()))
    return x[::-1] == x

if __name__ == '__main__':
    import sys
    for string in sys.argv[1:]:
        # check each command-line argument
        message = 'is a palindrome' if is_palindrome(string) else 'is not a palindrome'
        print(f'{string} {message}')
    else:
        # no arguments, so run self-test
        import doctest
        doctest.testmod()

It may well make sense to separate the pre-processing from the palindrome checking, so that is_palindrome() simply returns x[::-1] == x, and the caller is responsible for deciding which characters are significant.  We could call it with a specific canonicalisation:
is_palindrome(string.lower())

More advanced would be to pass a normalisation function and/or a character filter, as optional arguments:
def is_palindrome(s, normalise=None, char_filter=None):
    '''
    True if the letters of x are the same when
    reversed, ignoring differences of case.
    &gt;&gt;&gt; is_palindrome('')
    True
    &gt;&gt;&gt; is_palindrome('a')
    True
    &gt;&gt;&gt; is_palindrome('a0')
    False
    &gt;&gt;&gt; is_palindrome('a0', char_filter=str.isalpha)
    True
    &gt;&gt;&gt; is_palindrome('ab')
    False
    &gt;&gt;&gt; is_palindrome('ab a')
    False
    &gt;&gt;&gt; is_palindrome('Aba')
    False
    &gt;&gt;&gt; is_palindrome('Aba', normalise=str.lower)
    True
    &gt;&gt;&gt; is_palindrome('Àbà', normalise=str.lower)
    True
    '''
    if normalise:
        s = normalise(s)
    if char_filter:
        s = ''.join(filter(char_filter, s))
    return s == ''.join(reversed(s))

Usage of these optional arguments should be apparent from the extra tests I've added.

Bug
Whether we use [::-1] or reversed() to reverse the input string, we have a bug when the input contains characters that are formed using combining accents, as demonstrated by these additional tests:
&gt;&gt;&gt; is_palindrome(&quot;o̅o&quot;) # o+overline, o
False
&gt;&gt;&gt; is_palindrome(&quot;o̅o̅&quot;) # o+overline, o+overline
True

Both of these fail, because we reverse the string by treating each Unicode character independently, rather than considering them as (possibly multi-character) letters.  To fix that, we'll need to find or create a combining-character-aware function to reverse a string - I'm not aware of such a thing in the Python standard library.