Check if a string is palindrome
Palindrome: If we reverse the string also we should get the original string.
Input:
s1= 'malayalam'
Source code:
if s1 == s1[::-1]:
print("string is an palindrome")
else:
print("string is not an palindrome")
Output:
string is an palindrome
Comments
Post a Comment