News for hackers. Stuff that matters.
Re:How To Write A Calculator in 70 Python Lines by edwintorok on Saturday February 23, 2013 @05:21PM (#5271741)
It accepts more than just numbers though:

  >>> print input()
  "a"+"b"
  ab
Re:How To Write A Calculator in 70 Python Lines by adr_ on Saturday February 23, 2013 @08:05PM (#5272221)

  try:print(lambda x:eval(x)if all(i in'0123456789.*/+-'for i in x)else'syntax error')(raw_input())
  except:print'error'
Re:How To Write A Calculator in 70 Python Lines by readme on Saturday February 23, 2013 @09:00PM (#5272399)
Mathematically, this is wrong.. a + b is not ab.
Re:How To Write A Calculator in 70 Python Lines by xxbondsxx on Saturday February 23, 2013 @09:36PM (#5272498)
It's not symbolic...
Re:How To Write A Calculator in 70 Python Lines by readme on Saturday February 23, 2013 @09:52PM (#5272558)
Of 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.
Re:How To Write A Calculator in 70 Python Lines by Hello71 on Saturday February 23, 2013 @06:10PM (#5271885)
it's a feature