5 ms·It accepts more than just numbers though: >>> print input() "a"+"b" abby edwintorok 14y agoIt accepts more than just numbers though: >>> print input() "a"+"b" abHello71 14y agoit's a featureadr_ 14y agotry:print(lambda x:eval(x)if all(i in'0123456789.*/+-'for i in x)else'syntax error')(raw_input()) except:print'error'readme 14y agoMathematically, this is wrong.. a + b is not ab.xxbondsxx 14y agoIt's not symbolic...readme 14y agoOf course. I understand that "a" + "b" when taken to mean "concatenate the strings" is "ab" but OP's post was a calculator. It would not have yielded this result.