From 5a070f041b792d74053e4cb10502470a187cab57 Mon Sep 17 00:00:00 2001 From: Abhilash Date: Tue, 20 May 2025 19:25:36 +0530 Subject: [PATCH] Added a simple calculator python script --- basic_cal.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 basic_cal.py diff --git a/basic_cal.py b/basic_cal.py new file mode 100644 index 00000000000..6629ad178db --- /dev/null +++ b/basic_cal.py @@ -0,0 +1,8 @@ +while True: + try: + print(eval(input("enter digits with operator (e.g. 5+5)\n"))) + except: + print("Invalid Input, try again..") + +# Simple Calculator using eval() in Python +# This calculator takes user input like "5+5" or "10/2" and shows the result. \ No newline at end of file