Skip to content
6 changes: 5 additions & 1 deletion labs/lab_1/lab_1a.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@



"""
lab_1a.py

Expand All @@ -8,9 +11,10 @@
def main():
print("Hello World!")

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

print(f"{name}, Welcome to the CSS course!")
print("Hello my name is Aaryav and I making my second commit to the Git tree!")

if __name__ == "__main__":
main()
10 changes: 9 additions & 1 deletion labs/lab_1/lab_1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ def simple_calculator(operation: str, num1: float, num2: float) -> float:
raise ValueError("Cannot divide by zero.")
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 All @@ -49,6 +56,7 @@ def main():
# Perform the calculation and display the result
result = simple_calculator(operation, num1, num2)
print(f"The result of {operation}ing {num1} and {num2} is: {result}")
print("test")


if __name__ == "__main__":
Expand Down