palindrome.py 311 B

12345678
  1. #Alternative program at https://github.com/PythonCoder8/python-sandbox/blob/main/palindrome-alternative.py
  2. text = input('Enter any text or number: ')
  3. if text[::-1] == text:
  4. print(f'The text "{text}" is a palindrome')
  5. elif text[::-1] != text:
  6. print(f'The text "{text}" is not a palindrome.')