diff --git a/labs/lab_1/lab_1a.py b/labs/lab_1/lab_1a.py index 9d15ec83..1b09cad7 100644 --- a/labs/lab_1/lab_1a.py +++ b/labs/lab_1/lab_1a.py @@ -3,12 +3,14 @@ The first lab in the BWSI CSS course. To complete this lab, fill out the variable on line 10 with your name. Then, save the code, add it to the staging area, and commit it to the Git tree. + +This is to simulate a change made on a robot: robot_speed = 8 # m/s """ def main(): print("Hello World!") - name = "" # TODO: Insert your name between the double quotes + name = "Neel Casula" # TODO: Insert your name between the double quotes print(f"{name}, Welcome to the CSS course!") diff --git a/labs/lab_1/lab_1c.py b/labs/lab_1/lab_1c.py index 40cf98db..5f1369e5 100644 --- a/labs/lab_1/lab_1c.py +++ b/labs/lab_1/lab_1c.py @@ -24,7 +24,7 @@ def max_subarray_sum(nums: list[int]) -> int: for num in nums: max_current = max(num, max_current + num) - if max_current < max_global: + if max_current > max_global: max_global = max_current return max_global diff --git a/labs/lab_1/lab_1d.py b/labs/lab_1/lab_1d.py index ade4b4a8..1506810a 100644 --- a/labs/lab_1/lab_1d.py +++ b/labs/lab_1/lab_1d.py @@ -23,7 +23,7 @@ def two_sum(nums: list[int], target: int) -> list[int]: num_to_index = {} for index, num in enumerate(nums): - complement = target + num + complement = target - num if complement in num_to_index: return [num_to_index[complement], index] num_to_index[num] = index diff --git a/tests/.github/workflows/run_test.yml b/tests/.github/workflows/run_test.yml new file mode 100644 index 00000000..e69de29b diff --git a/tests/tests_1b.py b/tests/tests_1b.py index be6b822d..5289a12a 100644 --- a/tests/tests_1b.py +++ b/tests/tests_1b.py @@ -8,7 +8,7 @@ from labs.lab_1.lab_1b import simple_calculator def test_addition(): - assert simple_calculator("add", 5, 3) == 8 # Test for positive numbers + assert simple_calculator("add", 5, 3) == 8 # Test for positive numbers assert simple_calculator("add", -2, 2) == 0 # Test for negative and positive number assert simple_calculator("add", 0, 0) == 0 # Test for zero addition