python coding contest

Shane Hathaway shane at hathawaymix.org
Tue Dec 27 10:33:19 CET 2005


Paul McGuire wrote:
> "Paul McGuire" <ptmcg at austin.rr._bogus_.com> wrote in message
> news:0v6sf.9742$9e.3250 at tornado.texas.rr.com...
> <snip>
> 
>>Well *I'm* certainly looking forward to learning some new tricks!  My
>>(non-cheat) version is a comparatively-portly 245, and no alternatives are
>>popping into my head at the moment!
>>
>>-- Paul
>>
>>
> 
> down to 2 lines, 229 characters

I'm down to 133 characters (counted according to 'wc -c') on a single 
line.  It contains about 11 whitespace characters (depending on what you 
consider whitespace.)  It's way too tricky for my taste, but it's fun to 
play anyway.  Has anyone done better so far?  Here's a hint on my 
strategy: the code contains three large integers. :-)

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()

Shane



More information about the Python-list mailing list