Skip to content

Creating pull request to fix the code to pass test cases #4

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 17 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
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: python
script: python -m unittest discover -s ./src/test/ -p '*_test.py'

9 changes: 5 additions & 4 deletions src/main/calculator.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# 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 # TODO - Implement solution

def subtract(self, a, b):
return None # TODO - Implement solution
return a - b # TODO - Implement solution

def multiply(self, a, b):
return None # TODO - Implement solution
return a * b # TODO - Implement solution

def divide(self, a, b):
return None # TODO - Implement solution
return round((a/b), 3)# TODO - Implement solution
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
21 changes: 17 additions & 4 deletions src/main/predicator.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
# 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 # TODO - Implement solution

def is_greater_than_8(self, some_value):
return None # TODO - Implement solution
if some_value > 8:
return True
else:
return False # TODO - Implement solution

def is_less_than_4(self, some_value):
return None # TODO - Implement solution
if some_value < 4:
return True
else:
return False # TODO - Implement solution

def is_less_than_1(self, some_value):
return None # TODO - Implement solution
if some_value < 1:
return True
else:
return False # TODO - Implement solution
31 changes: 24 additions & 7 deletions src/main/string_evaluator.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,45 @@
# 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" # TODO - Implement solution

def concatenate(self, value_to_be_added_to, value_to_add):
return None # TODO - Implement solution
a = str(value_to_be_added_to)
b = str(value_to_add)
c = a + b
return c # TODO - Implement solution

def substring_inclusive(self, string_to_fetch_from, starting_index, ending_index):
return None # TODO - Implement solution
string = string_to_fetch_from[starting_index:ending_index+1]
return string # TODO - Implement solution

def substring_exclusive(self, string_to_fetch_from, starting_index, ending_index):
return None # TODO - Implement solution
line = string_to_fetch_from[starting_index+1:ending_index]
return line # TODO - Implement solution

def compare(self, first_value, second_value):
return None # TODO - Implement solution
if str(first_value) == str(second_value):
return True
elif first_value == None and second_value == 0:
return True
elif first_value == False and second_value == 0:
return True
elif first_value == True and second_value == 1:
return True
else:
return False # TODO - Implement solution

def get_middle_character(self, string_to_fetch_from):
return None # TODO - Implement solution

def get_first_word(self, string_to_fetch_from):
return None # TODO - Implement solution
word = string_to_fetch_from.split()
return word[0]# TODO - Implement solution

def get_second_word(self, string_to_fetch_from):
return None # TODO - Implement solution
word2 = string_to_fetch_from.split()
return word2[1] # TODO - Implement solution

def reverse(self, string_to_be_reversed):
return None # TODO - Implement solution