Palindrome or NOT a Palindrome ?

 The following program takes a user input, be it a number or any word, and tells whether the input is a palindrome or not.


   '''
Whether a given word or number is a palindrome or not?
'''
while True:
    word = input("Enter a word or number:\n")
    if word == word[::-1]:
        print(f"{word} is a palindrome")
    else:
        print(f"{word} is not a palindrome")

    

Comments

Popular posts from this blog

Quotation marks to wrap an element in HTML

The Basic Structure of a Full-Stack Web App

Unlocking Web Design: A Guide to Mastering CSS Layout Modes