maynul67

Palindrome Checker

Jul 17th, 2021
470
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. string1 = input("Enter string: ")
  2. string_nowhitespace = string1.replace(" ","")
  3.  
  4. string_reverse = string_nowhitespace[::-1]
  5.  
  6. if string_reverse == string_nowhitespace:
  7.     print("Palindrome")
  8. else:
  9.     print("No Palindrome")
  10.  
RAW Paste Data