Skip to content

Instantly share code, notes, and snippets.

@roman-on
Created April 9, 2020 16:53
Show Gist options
  • Select an option

  • Save roman-on/3f1b82f22a54a7b4cc1d952cd9642e1a to your computer and use it in GitHub Desktop.

Select an option

Save roman-on/3f1b82f22a54a7b4cc1d952cd9642e1a to your computer and use it in GitHub Desktop.
"""
Write a program that receives a string from the user and prints 'OK' if it is Plindrome, otherwise 'NOT'.
Instructions
Plindrome is a string (word, number, or any sequence of characters) whose right-to-left reading is the same as reading from left to right. pay attention:
No small or large letters are important.
Spaces ignored.
Do not use loops.
"""
# sun , bob , Borrow or rob
# NOT OK OK
word = input("Enter a word:").lower()
if word.replace(" ", "") == word[::-1].replace(" ", ""):
print("OK")
else:
print("NOT")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment