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
    else:
        return False

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

1 Like

@kinnukeshiya

It is the half answer, please paste your answer.

1 Like

i corrected . thank you

1 Like