Skip to content

Instantly share code, notes, and snippets.

@valarpirai
Created July 25, 2017 07:02
Show Gist options
  • Save valarpirai/3fffa3ced6b38a3f0f86b2520ecbfb56 to your computer and use it in GitHub Desktop.
Save valarpirai/3fffa3ced6b38a3f0f86b2520ecbfb56 to your computer and use it in GitHub Desktop.
Python Palindrome
class Palindrome:
@staticmethod
def is_palindrome(word):
word = word.lower()
l = len(word) // 2
palindrome = True
for i in range(l):
j = -(i+1)
if word[i] != word[j]:
palindrome = False
return palindrome
print(Palindrome.is_palindrome('Deleveled'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment