From aa4900cfb1b5a0c5170bedacc18b1b9f0d86c89a Mon Sep 17 00:00:00 2001 From: Daniel Morales <55546610+damora-code@users.noreply.github.com> Date: Wed, 14 Oct 2020 16:54:55 -0400 Subject: [PATCH] simple palindrome function --- Python/palindrome.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Python/palindrome.py diff --git a/Python/palindrome.py b/Python/palindrome.py new file mode 100644 index 0000000..444aa73 --- /dev/null +++ b/Python/palindrome.py @@ -0,0 +1,7 @@ +word = input("enter word: ") +word = word.casefold() +reverse_word = reversed(word) +if list(word) == list(reverse_word): + print("The string is a palindrome.") +else: + print("The string is not a palindrome.")