From 0dab46d30c05eb5702998858e918f835735a554b Mon Sep 17 00:00:00 2001 From: Ilyas Shaikh <72152969+ilyas829@users.noreply.github.com> Date: Thu, 3 Oct 2024 16:02:21 +0000 Subject: [PATCH 1/3] Added Calculator code in python --- Add Code Here/calculator.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Add Code Here/calculator.py diff --git a/Add Code Here/calculator.py b/Add Code Here/calculator.py new file mode 100644 index 00000000000..9167ceeafe9 --- /dev/null +++ b/Add Code Here/calculator.py @@ -0,0 +1,32 @@ +def add(a,b): + return (a+b) +def sub(a,b): + return (a-b) +def mult(a,b): + return (a*b) +def div(a,b): + return (a//b) + + +print("1. Addition") +print("2 . Subtraction") +print("3. Multiplication") +print("4. Division") + + +while True: + choice = int(input("Enter Choice ")) + if choice == 1 or choice ==2 or choice ==3 or choice ==4 or choice ==5: + a= int(input("Enter 1st number")) + b= int(input("Enter 2nd number")) + if choice == 1: + print(add(a,b)) + elif choice == 2: + print(sub(a,b)) + elif choice == 3: + print(mult(a,b)) + elif choice == 4: + print(div(a,b)) + else: + print("Enter valid choice") + break \ No newline at end of file From ccfce883fec274111ff61ff3fb5c11637096fa22 Mon Sep 17 00:00:00 2001 From: Ilyas Shaikh <72152969+ilyas829@users.noreply.github.com> Date: Thu, 3 Oct 2024 16:08:15 +0000 Subject: [PATCH 2/3] I was here @ hactoberfest --- content/ilyas829.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 content/ilyas829.md diff --git a/content/ilyas829.md b/content/ilyas829.md new file mode 100644 index 00000000000..c093726bf98 --- /dev/null +++ b/content/ilyas829.md @@ -0,0 +1,4 @@ +name: ilyas829 +institution: SIBAR +github:[**ilyas829**](https://github.com/ilyas829) +Ilyas was here \ No newline at end of file From 6adf5e4f3273416aa23f78d50cd15ccdd89221d2 Mon Sep 17 00:00:00 2001 From: Ilyas Shaikh <72152969+ilyas829@users.noreply.github.com> Date: Thu, 3 Oct 2024 16:10:26 +0000 Subject: [PATCH 3/3] I was here @ hactoberfest --- content/ilyas829.md | 1 - 1 file changed, 1 deletion(-) diff --git a/content/ilyas829.md b/content/ilyas829.md index c093726bf98..ec1b1b229cb 100644 --- a/content/ilyas829.md +++ b/content/ilyas829.md @@ -1,4 +1,3 @@ name: ilyas829 institution: SIBAR github:[**ilyas829**](https://github.com/ilyas829) -Ilyas was here \ No newline at end of file