def is_palindrome(word): ''' checks if word is a palindrome ''' for i in range(len(word)): if word[i]!=word[-(i+1)]: # mismatch, no palindrome return False return True # matches all the way, a palindrome def is_palindrome_print(word): ''' checks if word is a palindrome, while printing diagnostic values ''' for i in range(len(word)): print(i,word[i],word[-(i+1)]) if word[i]!=word[-(i+1)]: # mismatch, no palindrome return False return True # matches all the way, a palindrome def is_palindrome2(word): ''' checks if word is a palindrome ''' return(word == word[::-1]) # does word equal its reverse