Computer Science, asked by Hasib289, 1 year ago

How to Check Whether a String is Palindrome or Not using Python?

Answers

Answered by harivzm0
0
s=input("enter a string-- ")

l=len(s)

if s[::1]==s[::-1]:

print("palindrome")

else:

print("not a palindrome")
Answered by abhishek1301
0

Answer:

def Palindromecheck(s):

   return s == s[::-1]

 

  s = "apple"

ans = Palindromecheck(s)

 

if ans:

   print("Yes")

else:

   print("No")

Similar questions