Re: python coding contest

Discussion in 'Python' started by Jean-Paul Calderone, Dec 27, 2005.

  1. 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
    Jean-Paul Calderone, Dec 27, 2005
    #1
    1. Advertising

  2. 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
    Marius Gedminas, Dec 28, 2005
    #2
    1. Advertising

  3. Jean-Paul Calderone

    Tim Hochberg Guest

    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
    >
    Tim Hochberg, Dec 28, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon Hengel

    python coding contest

    Simon Hengel, Dec 25, 2005, in forum: Python
    Replies:
    23
    Views:
    697
    Claudio Grondi
    Jan 2, 2006
  2. Simon Hengel

    Re: python coding contest

    Simon Hengel, Dec 25, 2005, in forum: Python
    Replies:
    92
    Views:
    1,412
    Alex Martelli
    Jan 2, 2006
  3. Christian Tismer

    Re: python coding contest

    Christian Tismer, Dec 25, 2005, in forum: Python
    Replies:
    4
    Views:
    283
    Alex Martelli
    Dec 26, 2005
  4. Tim Hochberg

    Re: python coding contest

    Tim Hochberg, Dec 25, 2005, in forum: Python
    Replies:
    3
    Views:
    283
    Alex Martelli
    Dec 26, 2005
  5. Tim Peters

    Re: python coding contest

    Tim Peters, Dec 26, 2005, in forum: Python
    Replies:
    0
    Views:
    417
    Tim Peters
    Dec 26, 2005
Loading...

Share This Page