I am trying to check for a palindrome. I keep getting errors when reaching the first if statement. I feel it is because i returns as a letter and not the position number in the string. What am I missing?
def palindrome(str): s=(str) sum=len(s) l=int(sum/2) for i in s[0:l]: if i == (len(s)-1-i): print "This word is a palindrome" else: print "This word is not a palindrome"