Re: solve a newspaper quiz

2010-05-10 Thread Francesco Bochicchio
On 9 Mag, 11:20, superpollo wrote: > "if a b c are digits, solve ab:c=a*c+b" > > solved in one minute with no thought: > > for a in range(10): >      for b in range(10): >          for c in range(10): >              try: >                  if (10.*a+b)/c==a*c+b: >                      print "%i%i:

Re: solve a newspaper quiz

2010-05-09 Thread Alain Ketterlin
superpollo writes: > "if a b c are digits, solve ab:c=a*c+b" > > solved in one minute with no thought: Obviously. > for a in range(10): > for b in range(10): > for c in range(10): > try: > if (10.*a+b)/c==a*c+b: > print "%i%i:%i=%i*%i+

Re: solve a newspaper quiz

2010-05-09 Thread Andre Engels
On Sun, May 9, 2010 at 11:31 AM, Xavier Ho wrote: > On Sun, May 9, 2010 at 7:20 PM, superpollo wrote: >> >> "if a b c are digits, solve ab:c=a*c+b" > > Sorry, what does the notation ab:c mean? The number ab divided by c. -- André Engels, andreeng...@gmail.com -- http://mail.python.org/mailma

Re: solve a newspaper quiz

2010-05-09 Thread Xavier Ho
On Sun, May 9, 2010 at 7:20 PM, superpollo wrote: > "if a b c are digits, solve ab:c=a*c+b" > Sorry, what does the notation ab:c mean? Cheers, Xav -- http://mail.python.org/mailman/listinfo/python-list

solve a newspaper quiz

2010-05-09 Thread superpollo
"if a b c are digits, solve ab:c=a*c+b" solved in one minute with no thought: for a in range(10): for b in range(10): for c in range(10): try: if (10.*a+b)/c==a*c+b: print "%i%i:%i=%i*%i+%i" % (a,b,c,a,c,b) except: