Palindrome - 2
You are given a string, write a program to find whether the string is palindrome or not.
The first line of input is a string.
The output should be the string
In the given example, the string
Madam is a palindrome as we are treating M and m as equal. So, the output should be True.
Sample Input 1
Madam
Sample Output 1
True
Sample Input 2
Treat
Sample Output 2
False
word = ''
for ch in input():
word += ch.lower()
reversed_word = word[::-1]
print(word == reversed_word)
Comments
Leave a comment