python coding contest
Marius Gedminas
mgedmin at gmail.com
Wed Dec 28 08:59:42 EST 2005
Jean-Paul Calderone wrote:
> On Tue, 27 Dec 2005 14:02:57 -0700, Tim Hochberg <tim.hochberg at ieee.org> wrote:
> >Shane Hathaway wrote:
> >> Paul McGuire wrote:
> >>
> >>
> >> Also, here's another cheat version. (No, 7seg.com does not exist.)
> >>
> >> import urllib2
> >> def seven_seg(x):return urllib2.urlopen('http://7seg.com/'+x).read()
> >>
> >And another one from me as well.
> >
> >class a:
> > def __eq__(s,o):return 1
> >seven_seg=lambda i:a()
> >
>
> This is shorter as "__eq__=lambda s,o:1".
Or even
class seven_seg(str):__eq__=lambda*a:1
39 characters; passes the test suite. I'm sure it would be
disqualified for cheating, though. :-)
> But I can't find the first post in this thread... What are you
> guys talking about?
http://www.pycontest.net
More information about the Python-list
mailing list