How can I invert a string to check that it is palindrome with python?

-1

Hello in advance I want to know how to invert a string to check that it is palindrome. Greetings. it occurred to me to do a for cycle and then each iteration to insert it in a list

    
asked by omam 29.09.2017 в 00:56
source

1 answer

1

Generates a reversed word in a method:

def esPalindrome(s):
    return s == s[::-1]

print esPalindrome('poop')
    
answered by 29.09.2017 в 01:00