Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #!/usr/bin/env/python3
  2. def isPalindrome():
  3. """
  4. by: gsilvapt
  5. Function to find if an input string is a palindrome.
  6. (str) -> str
  7. """
  8. word = input("Give me a word and I'll tell if it is a palindrome: ")
  9. if str(word) == str(word)[::-1]: # Checks if strings matches its reverse
  10. print ("Great!, the world is a palindrome.")
  11. else:
  12. print ("Sorry, the word is not a palindrome.")
  13.  
  14. if __name__ == "__main__":
  15. isPalindrome()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement