From a836aae40e5f25a421fe91109df3282a1176f5f4 Mon Sep 17 00:00:00 2001 From: Frank Zawacki <55039332+frankZawacki@users.noreply.github.com> Date: Thu, 3 Dec 2020 09:49:03 -0500 Subject: [PATCH 1/8] create .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..d1ad0ae --- /dev/null +++ b/.travis.yml @@ -0,0 +1 @@ +language: python From e6651546ed337ad89157f4617e642b3a7afd6820 Mon Sep 17 00:00:00 2001 From: Frank Zawacki <55039332+frankZawacki@users.noreply.github.com> Date: Thu, 3 Dec 2020 10:34:57 -0500 Subject: [PATCH 2/8] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index d1ad0ae..3c82faf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1 +1,2 @@ language: python +script: -pytest From d97673ab1d9758d0c508429a5bc3da76f1728989 Mon Sep 17 00:00:00 2001 From: Frank Zawacki <55039332+frankZawacki@users.noreply.github.com> Date: Thu, 3 Dec 2020 10:44:04 -0500 Subject: [PATCH 3/8] Update .travis.yml --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3c82faf..a846974 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,2 +1,5 @@ language: python -script: -pytest +install: + - pip install -r requirements.txt + - pip install . + From bf0646124202dc293037ae4b4a13e4e889d259b9 Mon Sep 17 00:00:00 2001 From: Frank Zawacki <55039332+frankZawacki@users.noreply.github.com> Date: Thu, 3 Dec 2020 10:47:46 -0500 Subject: [PATCH 4/8] Update .travis.yml --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index a846974..8cc61b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,4 +2,7 @@ language: python install: - pip install -r requirements.txt - pip install . + +script: + python -m unittest discover -s ./src/test/ -p '*_test.py' From 13ceab77f07c1408506f5cf9fb78d19e3ec6bc6c Mon Sep 17 00:00:00 2001 From: Frank Zawacki <55039332+frankZawacki@users.noreply.github.com> Date: Thu, 3 Dec 2020 10:49:25 -0500 Subject: [PATCH 5/8] Update .travis.yml --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8cc61b1..82b0e9a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,4 @@ language: python -install: - - pip install -r requirements.txt - - pip install . - script: python -m unittest discover -s ./src/test/ -p '*_test.py' From 18500b7a76de91465c52ddc620fc20df80c84109 Mon Sep 17 00:00:00 2001 From: frankZawacki Date: Thu, 3 Dec 2020 11:39:12 -0500 Subject: [PATCH 6/8] update calculator perscholas_rocks and predicator. --- src/main/calculator.py | 11 +++++++---- src/main/perscholas_rocks.py | 2 +- src/main/predicator.py | 23 +++++++++++++++++++---- src/main/string_evaluator.py | 2 +- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/main/calculator.py b/src/main/calculator.py index b874a57..b2b00ed 100644 --- a/src/main/calculator.py +++ b/src/main/calculator.py @@ -1,13 +1,16 @@ # Created by Leon Hunter at 9:54 AM 10/23/2020 class Calculator(object): def add(self, a, b): - return None # TODO - Implement solution + return a + b def subtract(self, a, b): - return None # TODO - Implement solution + return a - b def multiply(self, a, b): - return None # TODO - Implement solution + return a * b def divide(self, a, b): - return None # TODO - Implement solution + if (b != 0) + return a / b + else: + return ZeroDivisionError diff --git a/src/main/perscholas_rocks.py b/src/main/perscholas_rocks.py index d36d3bd..8b719cc 100644 --- a/src/main/perscholas_rocks.py +++ b/src/main/perscholas_rocks.py @@ -1 +1 @@ -# print("Perscholas Rocks!") # TODO - Implement solution \ No newline at end of file +print("Perscholas Rocks!") # TODO - Implement solution \ No newline at end of file diff --git a/src/main/predicator.py b/src/main/predicator.py index d0ca9bd..7cd48f3 100644 --- a/src/main/predicator.py +++ b/src/main/predicator.py @@ -1,13 +1,28 @@ # Created by Leon Hunter at 3:56 PM 10/23/2020 class Predicator(object): def is_greater_than_5(self, some_value): - return None # TODO - Implement solution + if (some_value > 5) + return True + else + return False + def is_greater_than_8(self, some_value): - return None # TODO - Implement solution + if (some_value > 8) + return True + else: + return False + def is_less_than_4(self, some_value): - return None # TODO - Implement solution + if (some_value < 4) + return True + else + return False + def is_less_than_1(self, some_value): - return None # TODO - Implement solution \ No newline at end of file + if(some_value < 1) + return True + else + return False \ No newline at end of file diff --git a/src/main/string_evaluator.py b/src/main/string_evaluator.py index 38b007a..cc75290 100644 --- a/src/main/string_evaluator.py +++ b/src/main/string_evaluator.py @@ -1,7 +1,7 @@ # Created by Leon Hunter at 3:57 PM 10/23/2020 class StringManipulator(object): def get_hello_world(self): - return None # TODO - Implement solution + return "Hello World" def concatenate(self, value_to_be_added_to, value_to_add): return None # TODO - Implement solution From b4c1683ce59c8e75f6b9e94ab1642bd40b117cab Mon Sep 17 00:00:00 2001 From: frankZawacki Date: Thu, 3 Dec 2020 11:47:46 -0500 Subject: [PATCH 7/8] update calc and predicator --- src/main/calculator.py | 2 +- src/main/predicator.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/calculator.py b/src/main/calculator.py index b2b00ed..aa95dc3 100644 --- a/src/main/calculator.py +++ b/src/main/calculator.py @@ -10,7 +10,7 @@ def multiply(self, a, b): return a * b def divide(self, a, b): - if (b != 0) + if (b != 0): return a / b else: return ZeroDivisionError diff --git a/src/main/predicator.py b/src/main/predicator.py index 7cd48f3..bd216a5 100644 --- a/src/main/predicator.py +++ b/src/main/predicator.py @@ -1,28 +1,28 @@ # Created by Leon Hunter at 3:56 PM 10/23/2020 class Predicator(object): def is_greater_than_5(self, some_value): - if (some_value > 5) + if (some_value > 5): return True else return False def is_greater_than_8(self, some_value): - if (some_value > 8) + if (some_value > 8): return True else: return False def is_less_than_4(self, some_value): - if (some_value < 4) + if (some_value < 4): return True else return False def is_less_than_1(self, some_value): - if(some_value < 1) + if(some_value < 1): return True else return False \ No newline at end of file From e9a75151574690446b81285986fdcd5efac16cd5 Mon Sep 17 00:00:00 2001 From: frankZawacki Date: Thu, 3 Dec 2020 14:43:59 -0500 Subject: [PATCH 8/8] update string_evaluator --- src/main/predicator.py | 6 +++--- src/main/string_evaluator.py | 15 ++++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/predicator.py b/src/main/predicator.py index bd216a5..fa60e5e 100644 --- a/src/main/predicator.py +++ b/src/main/predicator.py @@ -3,7 +3,7 @@ class Predicator(object): def is_greater_than_5(self, some_value): if (some_value > 5): return True - else + else: return False @@ -17,12 +17,12 @@ def is_greater_than_8(self, some_value): def is_less_than_4(self, some_value): if (some_value < 4): return True - else + else: return False def is_less_than_1(self, some_value): if(some_value < 1): return True - else + else: return False \ No newline at end of file diff --git a/src/main/string_evaluator.py b/src/main/string_evaluator.py index cc75290..b10793f 100644 --- a/src/main/string_evaluator.py +++ b/src/main/string_evaluator.py @@ -4,25 +4,26 @@ def get_hello_world(self): return "Hello World" def concatenate(self, value_to_be_added_to, value_to_add): - return None # TODO - Implement solution + return value_to_be_added_to + value_to_add def substring_inclusive(self, string_to_fetch_from, starting_index, ending_index): - return None # TODO - Implement solution + return string_to_fetch_from[starting_index : ending_index] def substring_exclusive(self, string_to_fetch_from, starting_index, ending_index): - return None # TODO - Implement solution + return string_to_fetch_from[starting_index +1 : ending_index -1] def compare(self, first_value, second_value): - return None # TODO - Implement solution + return first_value == second_value def get_middle_character(self, string_to_fetch_from): - return None # TODO - Implement solution + middleIndex = len(string_to_fetch_from)/2 + return string_to_fetch_from[middleIndex] def get_first_word(self, string_to_fetch_from): - return None # TODO - Implement solution + return string_to_fetch_from.split(" ") def get_second_word(self, string_to_fetch_from): return None # TODO - Implement solution def reverse(self, string_to_be_reversed): - return None # TODO - Implement solution \ No newline at end of file + return string_to_be_reversed[::-1] \ No newline at end of file