From 1ae8dca62962b6e8f498b7e3005b55f4a900c71e Mon Sep 17 00:00:00 2001 From: Bekk Blando Date: Wed, 27 May 2015 10:59:18 -0400 Subject: [PATCH 1/7] Just getting started Just starting the HW --- palindrome_checker.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 palindrome_checker.py diff --git a/palindrome_checker.py b/palindrome_checker.py new file mode 100644 index 0000000..5daec82 --- /dev/null +++ b/palindrome_checker.py @@ -0,0 +1 @@ +palindrome=input("What's your palindrome? ") From e8747a5c561108acdc79b989ad2b0809b706ec4e Mon Sep 17 00:00:00 2001 From: Bekk Blando Date: Wed, 27 May 2015 11:53:35 -0400 Subject: [PATCH 2/7] Changed it to learn --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 77d46c0..0540865 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Determine if text is palindromic - +#Changed ## Description Write a program that asks the user for one or more sentences and then lets the user know if it is a palindrome. @@ -59,4 +59,4 @@ You may want to use the `re.sub` function to strip out punctuation and spaces. A * [Palindrome list](http://www.palindromelist.net/). * [String type in Python](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str). -* [Regular expression operations](https://docs.python.org/3/library/re.html). \ No newline at end of file +* [Regular expression operations](https://docs.python.org/3/library/re.html). From 9ee3bca557e621b0b5d93275d3a8c1bc20f0d487 Mon Sep 17 00:00:00 2001 From: Bekk Blando Date: Wed, 27 May 2015 18:18:53 -0400 Subject: [PATCH 3/7] This passes test.sh --- palindrome.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 palindrome.py diff --git a/palindrome.py b/palindrome.py new file mode 100644 index 0000000..d69b36e --- /dev/null +++ b/palindrome.py @@ -0,0 +1,21 @@ +palindrome=input("What's your palindrome? ") + +def check_palindrome(palindrome): + #for letter in palindrome: + punc=['.',',',':',';',"'","_","!"] + for punc_remove in punc: + palindrome=palindrome.replace(punc_remove,'') + palindrome=palindrome.lower() + palindrome_reverse=palindrome[::-1] + palindrome_reverse=palindrome_reverse.replace(' ','') + palindrome=palindrome.replace(' ','') + if palindrome==palindrome_reverse: + print("is a palindrome") + print(palindrome) + print(palindrome_reverse) + else: + print(palindrome) + print(palindrome_reverse) + print("is not a palindrome") + +check_palindrome(palindrome) From 350c8baac1903c7a0ffcd3514c1e755d2b8f0604 Mon Sep 17 00:00:00 2001 From: Bekk Blando Date: Wed, 27 May 2015 18:21:02 -0400 Subject: [PATCH 4/7] Renamed it to palindromes.py --- palindrome_checker.py | 1 - 1 file changed, 1 deletion(-) delete mode 100644 palindrome_checker.py diff --git a/palindrome_checker.py b/palindrome_checker.py deleted file mode 100644 index 5daec82..0000000 --- a/palindrome_checker.py +++ /dev/null @@ -1 +0,0 @@ -palindrome=input("What's your palindrome? ") From 6c8202bb640c54db29ad5b84321310451dd92740 Mon Sep 17 00:00:00 2001 From: Bekk Blando Date: Tue, 21 Jul 2015 16:31:06 -0400 Subject: [PATCH 5/7] Pep8 --- palindrome.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/palindrome.py b/palindrome.py index d69b36e..88c4021 100644 --- a/palindrome.py +++ b/palindrome.py @@ -1,15 +1,17 @@ -palindrome=input("What's your palindrome? ") + +palindrome = input("What's your palindrome? ") + def check_palindrome(palindrome): - #for letter in palindrome: - punc=['.',',',':',';',"'","_","!"] + # for letter in palindrome: + punc = ['.', ',', ':', ';', "'", "_", "!"] for punc_remove in punc: - palindrome=palindrome.replace(punc_remove,'') - palindrome=palindrome.lower() - palindrome_reverse=palindrome[::-1] - palindrome_reverse=palindrome_reverse.replace(' ','') - palindrome=palindrome.replace(' ','') - if palindrome==palindrome_reverse: + palindrome = palindrome.replace(punc_remove, '') + palindrome = palindrome.lower() + palindrome_reverse = palindrome[::-1] + palindrome_reverse = palindrome_reverse.replace(' ', '') + palindrome = palindrome.replace(' ', '') + if palindrome == palindrome_reverse: print("is a palindrome") print(palindrome) print(palindrome_reverse) From 545f157540b649edabe59f2f3825cddc0dee621f Mon Sep 17 00:00:00 2001 From: Bekk Blando Date: Tue, 18 Aug 2015 10:07:54 -0400 Subject: [PATCH 6/7] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0540865..c44fcf2 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +Learned about string munipulation. # Determine if text is palindromic #Changed ## Description From 38ac269b958e842ece0fc5ac7cabf7d9ee4b21c5 Mon Sep 17 00:00:00 2001 From: Bekk Blando Date: Sat, 31 Dec 2016 16:02:52 -0500 Subject: [PATCH 7/7] Fixed Typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c44fcf2..1df5fbf 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Learned about string munipulation. +Learned about string manipulation. # Determine if text is palindromic #Changed ## Description