it works for me when indentation is correct
def is_palindrome(word): word_start = '' for letter in word: word_start = letter + word_start if word == word_start: return True return False for word in ['radar', 'blabla']: print(f"{word} ==> {is_palindrome(word)}")
Output:radar ==> True
blabla ==> False
and for improvements, welldef is_palindrome(word): return word == word[::-1]
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs