How to Check Whether a String is Palindrome or Not using Python?
Answers
Answered by
0
s=input("enter a string-- ")
l=len(s)
if s[::1]==s[::-1]:
print("palindrome")
else:
print("not a palindrome")
l=len(s)
if s[::1]==s[::-1]:
print("palindrome")
else:
print("not a palindrome")
Answered by
0
Answer:
def Palindromecheck(s):
return s == s[::-1]
s = "apple"
ans = Palindromecheck(s)
if ans:
print("Yes")
else:
print("No")
Similar questions
English,
6 months ago
English,
1 year ago
Psychology,
1 year ago
Science,
1 year ago
Physics,
1 year ago