aboutsummaryrefslogtreecommitdiff
path: root/challenge-143/eric-cheung/python/ch-1.py
blob: 4820b6c769e11ab9711dfe4e6df72067186a0643 (plain)
1
2
3
4
5
6
7
8
9
## Calculator
import os

strMathExpr = "10 + 20 - 5" ## Example 1
## strMathExpr = "(10 + 20 - 5) * 2" ## Example 2

print (strMathExpr + " = " + str(eval(strMathExpr)))

os.system("pause")