Skip to content

Commit 5a070f0

Browse files
committed
Added a simple calculator python script
1 parent 7ff9fee commit 5a070f0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

basic_cal.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
while True:
2+
try:
3+
print(eval(input("enter digits with operator (e.g. 5+5)\n")))
4+
except:
5+
print("Invalid Input, try again..")
6+
7+
# Simple Calculator using eval() in Python
8+
# This calculator takes user input like "5+5" or "10/2" and shows the result.

0 commit comments

Comments
 (0)