Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

class Palindrome:

@staticmethod

def is_palindrome(word):

#Please write your code here.

return None

word = input()

print(Palindrome.is_palindrome(word))

class Palindrome:

@staticmethod

def is_palindrome(word):

if len(word) <= 1:

return True

else:

if word[0] != word[len(word)-1]:

return False

else:

return is_palindrome(word[1:len(word)-1])

return None

word = input()

print(Palindrome.is_palindrome(word))

ΣΩΣΤΟ

word = input()

x = ''.join(reversed(word))

if word == x:

print('TRUE')
else:

print('false')

print(''.join(reversed(word)))

SOSTO ME CLASS

class Palindrome:

@staticmethod

def is_palindrome(word):

x = ''.join(reversed(word))

if(x == word):

return True

else:

return False

word = input()

print(Palindrome.is_palindrome(word))

You might also like