As a newbie programmer

They see me Palindroming @ Dcoder

Dcoder icon

Problem: In india there is a puzzle"5 characters my name, reverse- forward is the same." You will be presented with a 5 character String, you have to tell whether it satisfy above puzzle, if yes output "Yes" else "No"

Input: Input is String S of 5 characters.

Output: Print "Yes" if the String S satisfies above constraints, else "No".

Constraints: String length = 5

Sample Input: level

Sample Output: 

Yes

s = input()
print('Yes' if s == s[::-1] else 'No')

How do you rate this article?

2


Lochard
Lochard

20240228 Arrived in the UK for about 2 week. All my fears persist. Some are even getting worse. https://github.com/locharp/asylum_diary/


As a newbie programmer
As a newbie programmer

Sharing entry level codes. My snippets on GitHub https://github.com/locharp/code-snippets

Publish0x Publish0x

Reward the author with $0.01 in crypto, and earn yourself as you read!

20% to author / 80% to me.
Rewards are FREE. Publish0x pays them, not you.

Page not displaying correctly?