Palindrome Checker
Check whether a given string reads the same forwards and backwards (a palindrome), ignoring letter case.
Approach: compare the lower-cased string to its own reverse using slicing (s[::-1]).
Input: One line: a word or phrase.
Output: One line: <original> is a palindrome or <original> is not a palindrome — using the original text's casing in the message, but comparing case-insensitively.
Madam
Madam is a palindrome
- 1 <= length <= 1000
Hint 1
s[::-1] reverses a string using slicing with a step of -1.
Hint 2
Compare s.lower() to s.lower()[::-1] so the check ignores case.
Hint 3
Print the ORIGINAL string s in the message, not the lower-cased version.
Lower-case the string so the comparison ignores letter case, then compare it to its own reverse using slicing: s.lower() == s.lower()[::-1]. The printed message uses the original (unmodified) string — only the comparison itself is case-insensitive.