Skip to content

Instantly share code, notes, and snippets.

@jatinsharrma
Created May 14, 2019 21:12
Show Gist options
  • Save jatinsharrma/994cc8c25a54ba94740d734e581e9d38 to your computer and use it in GitHub Desktop.
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.
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