Question
To Check whether the String is Palindrome or not.
Sample TestCase Expected Output
1. MalayalamYes
2. PythonNo
Answer
def isPalindrome(s):
return s == s[::-1]
s = input("Enter a string:")
ans = isPalindrome(s)
if ans:
print("Yes")
else:
print("No")
return s == s[::-1]
s = input("Enter a string:")
ans = isPalindrome(s)
if ans:
print("Yes")
else:
print("No")

No comments:
Post a Comment