HOME/Articles/

palindrome checker (snippet)

Article Outline

Python example 'palindrome checker'. This checks if a string is a palindrome, a palindrome reads the same both ways.

palindrome checker

Python beginners example: palindrome checker

word=str(input('Enter the word to check:'))
reverse_word=word[::-1]


if word==reverse_word:
    print('the word ',word,'is a palindrome')


else:
    print('Just an ordinary word')