Skip to content
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: 3 additions & 1 deletion labs/lab_1/lab_1a.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!")

Expand Down
2 changes: 1 addition & 1 deletion labs/lab_1/lab_1c.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion labs/lab_1/lab_1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion tests/tests_1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down