From b75716e0aacb606c6ec4d08b544397a275d0f0ec Mon Sep 17 00:00:00 2001 From: Lance Rogers Date: Wed, 27 May 2015 12:00:48 -0400 Subject: [PATCH 1/3] commit --- new_file | 1 + 1 file changed, 1 insertion(+) create mode 100644 new_file diff --git a/new_file b/new_file new file mode 100644 index 0000000..2b082f1 --- /dev/null +++ b/new_file @@ -0,0 +1 @@ +This is a new file From 96437c705d821b0f7eef8c215d98cf3fb4df09cd Mon Sep 17 00:00:00 2001 From: Lance Rogers Date: Wed, 27 May 2015 23:48:21 -0400 Subject: [PATCH 2/3] nano --- palindrome.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 palindrome.py diff --git a/palindrome.py b/palindrome.py new file mode 100644 index 0000000..d0da546 --- /dev/null +++ b/palindrome.py @@ -0,0 +1,35 @@ +import re + +print("I am a program that determines if a word or phrase is a palindrome.") + + +initial = input("\nType your word or phrase here: ") + +def phrase(initial): +# save initial input for the output so that sentences dont appear jumbled + phrase = initial + + # change all letters to lowercase in string + phrase = phrase.lower() + + # ignore all special characters and numbers + phrase = re.sub('[0-9]+[\c]','',phrase) + + # remove spaces in string + phrase = phrase.replace(' ','') + return(phrase) + + + + +def forward_equals_backward(phrase): + # take the altered string and reverses it + b = phrase[::-1] + if phrase == '': + print("Invalid argument please enter a word or a phrase") + elif phrase == b: + print("\n{}".format(initial) + " is a palindrome") + else: + print("\n{}".format(initial) + " is not a palindrome") + +forward_equals_backward(initial) From a4bb488cf15044d85a09a23bb489b2a9e5396997 Mon Sep 17 00:00:00 2001 From: Lance Rogers Date: Fri, 29 May 2015 23:11:14 -0400 Subject: [PATCH 3/3] learning something --- learn.txt | 1 + new_file | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 learn.txt delete mode 100644 new_file diff --git a/learn.txt b/learn.txt new file mode 100644 index 0000000..969ac6a --- /dev/null +++ b/learn.txt @@ -0,0 +1 @@ +This is a file sent for learning purposes diff --git a/new_file b/new_file deleted file mode 100644 index 2b082f1..0000000 --- a/new_file +++ /dev/null @@ -1 +0,0 @@ -This is a new file