From bb89078336185172ccb99835c6861fe0a8284866 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 28 Oct 2019 14:37:47 +0530 Subject: [PATCH] python.py file --- python.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 python.py diff --git a/python.py b/python.py new file mode 100644 index 0000000..ace82d2 --- /dev/null +++ b/python.py @@ -0,0 +1,21 @@ +n=input("enter the calculation to be done in format (e to exit) : ") +while(n!='e'): + x=n.split(" ") + a=int(x[0]) + c=(x[1]) + b=int(x[2]) + if (c=='+'): + print(a+b) + elif(c=='-'): + print(a-b) + elif(c=='*'): + print(a*b) + elif(c=='/'): + print(a/b) + elif(c=='^'): + print(a**b) + else: + print("invalid syntax") + n=input("enter the calculation to be done in format (e to exit) : ") + +