Write a Python function that takes a string as input and returns True if the string is a palindrome (i.e., it reads the same forwards and backwards) and False otherwise DS301222

class p:
def is_palindrome(self,input_string):

    if input_string==input_string[::-1]:
        return True
        return False

user=input(“enter string”)
if obk.is_palindrome(user):
print(“the string is palindrom”)
print(“no, its not.”)

1 Like


It is the half answer, please paste your answer.

1 Like

i corrected . thank you

1 Like