Is this a palindrome?
You are asked to write a program that determines whether a given string is a palindrome.
😎 For the best results, use the zip
function along with for ... else
to write the code.
The first and only line of the input contains a string s
of characters.
The program should print Yes
if the string is a palindrome, or No
if it's not.
Input | Output |
---|---|
madam | Yes |
hello | No |
Note: For simplicity, assume that input strings are provided in lowercase letters only, and the string does not contain any special characters or spaces.
Constraints
Time limit: 2 seconds
Memory limit: 512 MB
Output limit: 1 MB