In Python you can do a couple of options
#compare first character with last character
def is_palindrome(string):
character_length = len(string)
midpoint = character_length//2
for i in range(midpoint):
if string[i] != string[-i -1]:
return False
return True
#pythonic solution
def is_palindrome(string):
return string == string[::-1]