palindrome-alternative.py 352 B

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