From d78022ecb247436385d3e838d2cbca1ba0c614bd Mon Sep 17 00:00:00 2001 From: Naman Markhedkar <77118629+marknaman05@users.noreply.github.com> Date: Mon, 10 Oct 2022 23:04:36 +0530 Subject: [PATCH] Create calc.py --- calc.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 calc.py diff --git a/calc.py b/calc.py new file mode 100644 index 0000000..9d252cd --- /dev/null +++ b/calc.py @@ -0,0 +1,23 @@ +def add(x,y): + print(x+y) +def subtract(x,y): + print(x-y) +def multiply(x,y): + print(x*y) +def divide(x,y): + print(x/y) +print("Enter two numbers") +n1=input() +n2=input() +print("Enter the operation +,-,,/ ") +op=input() +if op=='+': + add(int(n1),int(n2)) +elif op=='-': + subtract(int(n1),int(n2)) +elif op=='': + multiply(int(n1),int(n2)) +elif op=='/': + divide(int(n1),int(n2)) +else: + print(" Invalid entry ")