From d6c8cdfc90797b488e383bacd428806881ede9ab Mon Sep 17 00:00:00 2001 From: evakoshy1-bit Date: Tue, 17 Mar 2026 23:14:52 -0400 Subject: [PATCH 01/12] Update lab_1a.py commit --- labs/lab_1/lab_1a.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labs/lab_1/lab_1a.py b/labs/lab_1/lab_1a.py index 9d15ec83..f8574a08 100644 --- a/labs/lab_1/lab_1a.py +++ b/labs/lab_1/lab_1a.py @@ -8,7 +8,7 @@ def main(): print("Hello World!") - name = "" # TODO: Insert your name between the double quotes + name = "Eva" # TODO: Insert your name between the double quotes print(f"{name}, Welcome to the CSS course!") From 215a3340ae38fa9b854e589c3f3049b0aefaf2d6 Mon Sep 17 00:00:00 2001 From: evakoshy1-bit Date: Tue, 17 Mar 2026 23:18:24 -0400 Subject: [PATCH 02/12] Update lab_1a.py --- labs/lab_1/lab_1a.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labs/lab_1/lab_1a.py b/labs/lab_1/lab_1a.py index f8574a08..afcd3c21 100644 --- a/labs/lab_1/lab_1a.py +++ b/labs/lab_1/lab_1a.py @@ -11,6 +11,6 @@ def main(): name = "Eva" # TODO: Insert your name between the double quotes print(f"{name}, Welcome to the CSS course!") - + print("Hi, my name is Eva. I am a junior in highschool, and I enjoy learning about programming!") if __name__ == "__main__": main() From 9fd32901e321100546abe7f08591de1bece25da2 Mon Sep 17 00:00:00 2001 From: evakoshy1-bit Date: Tue, 17 Mar 2026 23:22:05 -0400 Subject: [PATCH 03/12] Update lab_1a.py --- labs/lab_1/lab_1a.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/labs/lab_1/lab_1a.py b/labs/lab_1/lab_1a.py index afcd3c21..d606bcfa 100644 --- a/labs/lab_1/lab_1a.py +++ b/labs/lab_1/lab_1a.py @@ -1,4 +1,20 @@ """ +This is to simulate a change made on a robot: robot_speed = 5 # m/s +lab_1a.py + +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. +""" + +def main(): + print("Hello World!") + + name = "Eva" # TODO: Insert your name between the double quotes + + print(f"{name}, Welcome to the CSS course!") + print("Hi, my name is Eva. I am a junior in highschool, and I enjoy learning about programming!") +if __name__ == "__main__": + main() lab_1a.py The first lab in the BWSI CSS course. To complete this lab, fill out the variable on line 10 From 2cfc7d56095c13f67380217dca8a13b15fb1bd1e Mon Sep 17 00:00:00 2001 From: evakoshy1-bit Date: Tue, 17 Mar 2026 23:24:15 -0400 Subject: [PATCH 04/12] Add comment about robot speed variable Added a comment explaining the purpose of the variable --- labs/lab_1/lab_1a.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labs/lab_1/lab_1a.py b/labs/lab_1/lab_1a.py index d606bcfa..77427260 100644 --- a/labs/lab_1/lab_1a.py +++ b/labs/lab_1/lab_1a.py @@ -1,5 +1,5 @@ """ -This is to simulate a change made on a robot: robot_speed = 5 # m/s +This is to simulate a change made on a robot: robot_speed = 5 # m/s lab_1a.py The first lab in the BWSI CSS course. To complete this lab, fill out the variable on line 10 From b99a3ce6aea29fa740e589d5c6112e577710a11c Mon Sep 17 00:00:00 2001 From: evakoshy1-bit Date: Tue, 17 Mar 2026 23:27:24 -0400 Subject: [PATCH 05/12] changes the 5 to a 3 --- labs/lab_1/lab_1a.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labs/lab_1/lab_1a.py b/labs/lab_1/lab_1a.py index 77427260..ed05c207 100644 --- a/labs/lab_1/lab_1a.py +++ b/labs/lab_1/lab_1a.py @@ -1,5 +1,5 @@ """ -This is to simulate a change made on a robot: robot_speed = 5 # m/s +This is to simulate a change made on a robot: robot_speed = 3 # m/s lab_1a.py The first lab in the BWSI CSS course. To complete this lab, fill out the variable on line 10 From 7d5025212171dabb8bd6e9a477d13f42a5ea436c Mon Sep 17 00:00:00 2001 From: evakoshy1-bit Date: Tue, 17 Mar 2026 23:32:45 -0400 Subject: [PATCH 06/12] fix --- labs/lab_1/lab_1a.py | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/labs/lab_1/lab_1a.py b/labs/lab_1/lab_1a.py index ed05c207..72a8f422 100644 --- a/labs/lab_1/lab_1a.py +++ b/labs/lab_1/lab_1a.py @@ -1,5 +1,5 @@ """ -This is to simulate a change made on a robot: robot_speed = 3 # m/s +This is to simulate a change made on a robot: robot_speed = 5 # m/s lab_1a.py The first lab in the BWSI CSS course. To complete this lab, fill out the variable on line 10 @@ -14,19 +14,4 @@ def main(): print(f"{name}, Welcome to the CSS course!") print("Hi, my name is Eva. I am a junior in highschool, and I enjoy learning about programming!") if __name__ == "__main__": - main() -lab_1a.py - -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. -""" - -def main(): - print("Hello World!") - - name = "Eva" # TODO: Insert your name between the double quotes - - print(f"{name}, Welcome to the CSS course!") - print("Hi, my name is Eva. I am a junior in highschool, and I enjoy learning about programming!") -if __name__ == "__main__": - main() + main() \ No newline at end of file From 35496a408308dd36e1fec636ae8b5e4ac16e16fa Mon Sep 17 00:00:00 2001 From: evakoshy1-bit Date: Tue, 17 Mar 2026 23:47:10 -0400 Subject: [PATCH 07/12] request sanitized number --- labs/lab_1/lab_1b.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/labs/lab_1/lab_1b.py b/labs/lab_1/lab_1b.py index e58dd957..aad11c7e 100644 --- a/labs/lab_1/lab_1b.py +++ b/labs/lab_1/lab_1b.py @@ -50,6 +50,13 @@ def main(): result = simple_calculator(operation, num1, num2) print(f"The result of {operation}ing {num1} and {num2} is: {result}") +def request_santized_number(prompt: str) -> float: + while True: + try: + number = float (input (prompt)) + return number + except ValueError: + print("Invalid input. Please enter a valid number.") if __name__ == "__main__": main() From 219333a04e94318256a8d60bdb6b8b26b916b9c6 Mon Sep 17 00:00:00 2001 From: evakoshy1-bit Date: Wed, 18 Mar 2026 13:23:31 -0400 Subject: [PATCH 08/12] delete --- labs/lab_1/lab_1b.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/labs/lab_1/lab_1b.py b/labs/lab_1/lab_1b.py index aad11c7e..522f4da9 100644 --- a/labs/lab_1/lab_1b.py +++ b/labs/lab_1/lab_1b.py @@ -50,13 +50,5 @@ def main(): result = simple_calculator(operation, num1, num2) print(f"The result of {operation}ing {num1} and {num2} is: {result}") -def request_santized_number(prompt: str) -> float: - while True: - try: - number = float (input (prompt)) - return number - except ValueError: - print("Invalid input. Please enter a valid number.") - if __name__ == "__main__": main() From e1777a8d78c16c14cc5466ac5fa74d9b23b9cae4 Mon Sep 17 00:00:00 2001 From: evakoshy1-bit Date: Wed, 18 Mar 2026 13:26:02 -0400 Subject: [PATCH 09/12] add request sanitized number --- labs/lab_1/lab_1b.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/labs/lab_1/lab_1b.py b/labs/lab_1/lab_1b.py index 522f4da9..83e1692a 100644 --- a/labs/lab_1/lab_1b.py +++ b/labs/lab_1/lab_1b.py @@ -37,6 +37,14 @@ def simple_calculator(operation: str, num1: float, num2: float) -> float: else: raise ValueError("Invalid operation. Please choose from 'add', 'subtract', 'multiply', or 'divide'.") +def request_santized_number(prompt: str) -> float: + while True: + try: + number = float (input (prompt)) + return number + except ValueError: + print("Invalid input. Please enter a valid number.") + def main(): print(f"===== Simple Calculator =====") From 6190872fb4d8a5cbb96e758367ef2c1f6adc8aee Mon Sep 17 00:00:00 2001 From: evakoshy1-bit Date: Wed, 18 Mar 2026 13:43:55 -0400 Subject: [PATCH 10/12] more tests --- tests/tests_1b.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/tests_1b.py b/tests/tests_1b.py index be6b822d..8c6fa033 100644 --- a/tests/tests_1b.py +++ b/tests/tests_1b.py @@ -37,5 +37,13 @@ def test_invalid_operation(): with pytest.raises(ValueError, match="Invalid operation. Please choose from 'add', 'subtract', 'multiply', or 'divide'."): simple_calculator("", 5, 3) # Test for empty operation +def test_large_numbers(): + assert simple_calculator("add", 1_000_000, 2_000_000) == 3_000_000 + assert simple_calculator("multiply", 10_000, 10_000) == 100_000_000 + +def test_negative_results(): + assert simple_calculator("subtract", 3, 5) == -2 + assert simple_calculator("divide", 1, -2) == -0.5 + if __name__ == "__main__": pytest.main() \ No newline at end of file From 4b7498cc0044ce7ab78bfad766a025f87fd9d01e Mon Sep 17 00:00:00 2001 From: evakoshy1-bit Date: Wed, 18 Mar 2026 13:57:11 -0400 Subject: [PATCH 11/12] move a folder --- workflows/run_test.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 workflows/run_test.yml diff --git a/workflows/run_test.yml b/workflows/run_test.yml new file mode 100644 index 00000000..c45bcbfc --- /dev/null +++ b/workflows/run_test.yml @@ -0,0 +1,32 @@ +name: simple_calculator unit test + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with Ruff + run: | + pip install ruff + ruff --format=github --target-version=py310 . + continue-on-error: true + - name: Test with pytest + run: | + coverage run -m pytest tests/tests_1b.py -v -s + - name: Generate Coverage Report + run: | + coverage report -m \ No newline at end of file From 66f560e6479af22e7c5b1f7d577390adf2f1a85f Mon Sep 17 00:00:00 2001 From: evakoshy1-bit Date: Wed, 18 Mar 2026 14:01:30 -0400 Subject: [PATCH 12/12] rearrange folders --- {workflows => .github/workflows}/run_test.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {workflows => .github/workflows}/run_test.yml (100%) diff --git a/workflows/run_test.yml b/.github/workflows/run_test.yml similarity index 100% rename from workflows/run_test.yml rename to .github/workflows/run_test.yml