Palindrome Check
Easy · 35 XPWrite is_palindrome(s) returning True if s reads the same reversed (ignore case). Print the result for "Level" and "Python".
Target output
True False
Blank · autosaved
PYpalindrome-check.py
Lowercase first: s = s.lower(); compare s == s[::-1].
def is_palindrome(s):
s = s.lower()
return s == s[::-1]
print(is_palindrome("Level"))
print(is_palindrome("Python"))
Run your code to check it…