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
7 changes: 5 additions & 2 deletions labs/lab_1/lab_1a.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
"""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
Expand All @@ -8,9 +8,12 @@
def main():
print("Hello World!")

name = "" # TODO: Insert your name between the double quotes
name = "Maxime Sobrier" # TODO: Insert your name between the double quotes

print(f"{name}, Welcome to the CSS course!")


print("It's great to see you here!")

if __name__ == "__main__":
main()
11 changes: 10 additions & 1 deletion labs/lab_1/lab_1b.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
"""TEST
lab_1b.py

This is a script that implements a simple calculator. It takes two numbers and an operation,
Expand Down Expand Up @@ -37,6 +37,15 @@ 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_Sanitized_number(prompt: str) -> float:

while True:
try:
number = float(input(prompt))
return number
except ValueError:
print("Invalid input")

def main():

print(f"===== Simple Calculator =====")
Expand Down