fork download
  1. def Calc():
  2. while(True):
  3. expr=input()
  4. if expr == "exit":
  5. return
  6. print(expr+"="+str(eval(expr)))
  7.  
  8. Calc()
  9.  
  10.  
Success #stdin #stdout 0.02s 9180KB
stdin
2+6*(9-12)
45+63/(22+3)-34
exit
stdout
2+6*(9-12)=-16
45+63/(22+3)-34=13.520000000000003