Created
May 14, 2019 21:12
-
-
Save jatinsharrma/994cc8c25a54ba94740d734e581e9d38 to your computer and use it in GitHub Desktop.
Python function to check whether the given string is a palindrome or not.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def check_palindrome(word): | |
length = len(word) | |
for i in range(int(length/2)): | |
if word[i] != word [length - i - 1]: | |
return 0 | |
return 1 | |
status=check_palindrome("malayalam") | |
if(status): | |
print("word is palindrome") | |
else: | |
print("word is not palindrome") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment