Program 101: Reverse and Palindrome using Python This program reverse the word/string and check whether it's palindrome or not. Palindrome: a word or phrases that reads the same backward or forward. Example: anna and madam. Note: It will remove white spaces Live Demo: https://onlinegdb.com/h0De12KzpK Code: # Reverse and Palindrome using Python word = input ("Enter an word: ").replace(" ","") # Reverse Word revs=''.join(reversed(word)) print("\n----- Result -----") print("Reverse Word:", revs) # Palindrome Checker print("Palindrome Checker:") if(word==word[::-1]): print(word , "is a palindrome") else: print(word , "is not a palindrome")
3 comments
It looks amazing
Haha at first o thought the program itself would be a palindrome. That woulda been 🤯
at first it was a reverse program then I added palindrome or not ahaha xD