Skip to content

pull changes from platformps #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: python
script:
python -m unittest discover -s ./src/test/ -p '*_test.py'

11 changes: 7 additions & 4 deletions src/main/calculator.py
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/main/perscholas_rocks.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# print("Perscholas Rocks!") # TODO - Implement solution
print("Perscholas Rocks!") # TODO - Implement solution
23 changes: 19 additions & 4 deletions src/main/predicator.py
Original file line number Diff line number Diff line change
@@ -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
if(some_value < 1):
return True
else:
return False
17 changes: 9 additions & 8 deletions src/main/string_evaluator.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
# 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
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
return string_to_be_reversed[::-1]