Skip to content

Commit e119ccf

Browse files
Merge pull request #2691 from LAbhilashKumar/fixing_issue_basic_cal
Added a simple calculator python script
2 parents a3914b8 + 5a070f0 commit e119ccf

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)