On 2017-09-27 16:38, Matt Wheeler wrote: > On Wed, 27 Sep 2017 at 13:58 Thomas Jollans <t...@tjol.eu> wrote: > >>> Reproducing the original string exactly the best I've managed is 260: >>> >>> t,f,a,o,n='True','False','and','or','not' >> >> The Not is capitalized in the original string. >> > > I guess you didn't try it? (or see `upper()` in the body of the `for` below)
Touché. You're still missing some whitespace, though ;-) (like, I think, everybody else in this weird international obfuscated Python competition) > >> l=[" Boolean Operators\n"+"-"*24] >>> for x in [(l,p,r)for p in(a,o)for l in(t,f)for r >> in(t,f)]+[(n,t),(n,f)]:x=' >>> '.join(x);l+=[x[0].upper()+x[1:]+" is "+str(eval(x))] >>> for i in 12,9,5,0:l.insert(i,'') >>> print('\n'.join(l)) > -- https://mail.python.org/mailman/listinfo/python-list