python coding contest

Szabolcs Nagy nszabolcs at
Fri Dec 30 18:24:45 CET 2005

my two solutions (well I wasn't so clever to encode everything in
strings instead of numbers, but at least it won't give warnings about
non ascii characters):
j,seven_seg=''.join,lambda s:j(j(' |_ |'[i>>3*int(c)&b]for c in s for b
in(4,2,1))+'\n'for i in(306775170,1060861645,524130191))

seven_seg=lambda s,j=''.join:j(j(' _   _|_| |_
|'[i>>3*int(c)&14:][:3]for c in s)+'\n'for i

More information about the Python-list mailing list