From 25a2776b603c7b5d59b5c0fb1915d346e654b19c Mon Sep 17 00:00:00 2001 From: Braeden McHugh Date: Wed, 12 Feb 2025 06:24:48 -0500 Subject: [PATCH] Adding addition --- hw01/main.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 hw01/main.py diff --git a/hw01/main.py b/hw01/main.py new file mode 100644 index 0000000..f931dcc --- /dev/null +++ b/hw01/main.py @@ -0,0 +1,20 @@ +def add(x,y): + return x+y + + +def calc(): + while(True): + operation = input("Enter operation from [+]: ") + if operation == "+": + break + print("Enter valid operation") + + x = float(input("1. Enter number: ")) + y = float(input("2. Enter number: ")) + + if operation == "+": + print(add(x,y)) + + +if __name__ == "__main__": + calc() \ No newline at end of file