palindrome-alternative.py 313 B

12345678
  1. text = input('Enter any text or number: ')
  2. class Solution(object):
  3. def isPalindrome(self,x):
  4. if str(x)[::-1] == str(x):
  5. return f'The text "{str(x)}"is a palindrome.'
  6. else:
  7. return f'The text "{str(x)}" is not a palindrome.'
  8. print(Solution().isPalindrome(text))