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
Post a Comment
Write something to CodeWithAbdur!