Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Palindrome in Python Using reverse function

def check_palindrome_1(string):
    reversed_string = string[::-1]
    status=1
    if(string!=reversed_string):
        status=0
    return status


string = input("Enter the string: ")
status= check_palindrome_1(string)
if(status):
    print("It is a palindrome ")
else:
    print("Sorry! Try again")
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Palindrome #Python #Using #reverse #function
ADD COMMENT
Topic
Name
3+1 =