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