python coding contest

Christian Tismer tismer at stackless.com
Tue Dec 27 02:09:15 CET 2005


Steven D'Aprano wrote:
> On Mon, 26 Dec 2005 13:33:42 -0700, Tim Hochberg wrote:
> 
>> Claudio Grondi wrote:
> 
>>> I am currently at 39 bytes following the requirements and the principle 
>>> given above (my module passes the test). Anyone able to beat that?
>> Wow! It'll be interesting to see how to do that. The obvious way gives 
>> 53 bytes. Hmmm, I'll have to see what can be done...
> 
> OBVIOUS???

The obvious way seems to be to import the test_vectors.py file,
which gives me

import test_vectors as x;seven_seg=x.test_vectors.get

as one possible "obvious" solution with 53 chars.

But
from test_vectors import*;seven_seg=test_vectors.get
has only 52.

And if you observe that their "test.py" file already does
all the imports we want, you can get to

from test import*;seven_seg=test_vectors.get
with 44 chars.

But I simply cant see how to get below that.
And I think this is not the wanted solution at all,
which is why I have no problem posting it here :-)

ciao - chris
-- 
Christian Tismer             :^)   <mailto:tismer at stackless.com>
tismerysoft GmbH             :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9A     :    *Starship* http://starship.python.net/
14109 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
work +49 30 802 86 56  mobile +49 173 24 18 776  fax +49 30 80 90 57 05
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
      whom do you want to sponsor today?   http://www.stackless.com/



More information about the Python-list mailing list