Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: python coding contest

Reply
Thread Tools

Re: python coding contest

 
 
Jean-Paul Calderone
Guest
Posts: n/a
 
      12-27-2005
On Tue, 27 Dec 2005 14:02:57 -0700, Tim Hochberg <> 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".

But I can't find the first post in this thread... What are you
guys talking about?

Jean-Paul

 
Reply With Quote
 
 
 
 
Marius Gedminas
Guest
Posts: n/a
 
      12-28-2005
Jean-Paul Calderone wrote:
> On Tue, 27 Dec 2005 14:02:57 -0700, Tim Hochberg <> 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

 
Reply With Quote
 
 
 
 
Tim Hochberg
Guest
Posts: n/a
 
      12-28-2005
Marius Gedminas wrote:
> Jean-Paul Calderone wrote:
>
>>On Tue, 27 Dec 2005 14:02:57 -0700, Tim Hochberg <> 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.



Tricky. That leads to this 30 character gem:

class seven_seg(str):__eq__=id

-tim

>
>
>>But I can't find the first post in this thread... What are you
>>guys talking about?

>
>
> http://www.pycontest.net
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
python coding contest Simon Hengel Python 23 01-02-2006 07:45 AM
Re: python coding contest Simon Hengel Python 92 01-02-2006 01:04 AM
Re: python coding contest Tim Peters Python 0 12-26-2005 03:28 AM
Re: python coding contest Christian Tismer Python 4 12-26-2005 02:54 AM
Re: python coding contest Tim Hochberg Python 3 12-26-2005 02:54 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57