diff --git a/newfile.txt b/newfile.txt new file mode 100644 index 0000000..751dee6 --- /dev/null +++ b/newfile.txt @@ -0,0 +1 @@ +htis is iss diff --git a/palindrome.py b/palindrome.py new file mode 100644 index 0000000..769b841 --- /dev/null +++ b/palindrome.py @@ -0,0 +1,13 @@ + +import re +string = input("Write a phrase, word or sentence") +def palin_drome(string): + response = str.lower(string) + response = re.sub(r'[A-Za-z]',"", response) + + print(response[::-1]) + if response == response[::-1]: + print("{} is a palindome".format(string)) + else: + print("{} is not a palindome".format(string)) +palin_drome(string)