recent

>>> COBOL COMPILER  >>> Make your Computer Welcome You  >>> Windows KMS Activator Free Download + How to Use Windows KMS Activator Ultimate Edition ...   >>> Remove Shortcut Virus From Pen Drive & SD Card  >>> Download and Install Turbo C++or C Software  >>> ലാപ്‌ടോപ് വാങ്ങുമ്പോള്‍ ഈ 6 കാര്യങ്ങൾ ശ്രദ്ധിക്കരുത്!...   >>> How to Get Deleted Files Back from USB or Hard Drive  >>> How To Make Your Own Subtitles With Any Text Editor  >>> How To Clean your RAM using Notepad  >>> Clear Recent Documents Windows 7 & 8    undefined

Saturday, 1 August 2015

Python Program to Check Whether a String is Palindrome or Not



n=raw_input("Enter the String:")
def palindrome(n):
    index=0
    check=True
    while index<len(n):
        if n[index]==n[-1-index]:
            index+=1
            return True
        return False
if palindrome(n)==True:
    print "It is a Palindrome"
else:
    print "It is not a Palindrome"

No comments :

Post a Comment