Skip to content

Python Program for string palindrome #1257

@PragatiNangare

Description

@PragatiNangare

function to check string is

palindrome or not

def isPalindrome(s):

     

    # Using predefined function to

    # reverse to string print(s)

    rev = ''.join(reversed(s))

 

    # Checking if both string are

    # equal or not

    if (s == rev):

        return True

    return False

 

main function

s = "malayalam"

ans = isPalindrome(s)

 

if (ans):

    print("Yes")

else:

    print("No")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions