03 digression by brute force

Joe Pfeiffer pfeiffer at cs.nmsu.edu
Wed Dec 12 00:03:42 EST 2018

"Avi Gross" <avigross at verizon.net> writes:

> SYNOPSIS: One way to solve math puzzle by brute force. (message sent earlier disappeared)
> Quick note. Jack started by asking why python does not like decimal
> numbers with leading zeroes. When asked to explain, he said he was
> trying to solve word problems using python. Someone mentioned problems
> like solving SEND + MORE = MONEY and I decided to quickly write a
> function that would solve anything of that sort that only has addition
> on either side of the equals.
> What amused me was that I had 25 solutions to the above when I was
> told there would be one. Closer examination showed that 24 of those
> had the ‘M’ in MONEY set to zero which the logicians claimed was not a
> sensible solution.

What amuses me is the solution to the problem that started the whole
thread had at least one number with a leading 0.

More information about the Python-list mailing list