Don't you find it amazing to discover words and sentences that have the same first and last letter? We just don't usually notice them, so we can try it out by coding out this problem instead! Print out "Yes" if the first and last characters of the given string are the same, and "No" otherwise. It doesn't matter if they're in lowercase or uppercase, as long as it's the same letter, it fits the description.
So, what are you waiting for? Code now!
Input
A line containing a string.
Pop·it·up
Output
A line containing a string.
Yes
text = input()
if text[0].upper == text[-1].upper:
print('Yes')
else:
print('No')
Comments
Leave a comment