pyContest - shortest Python coding contest

The pyContest is to make a Python program that pases some unit tests with the fewest number of characters possible. Mine has 191 characters, ranked 68 so far.
Here's my submission:
c=[
' _ _ _ _ _ _ _ _ ',
'| | | _| _||_||_ |_ ||_||_|',
'|_| ||_ _| | _||_| ||_| _|']
def seven_seg(x):
return '\n'.join([
''.join([l[n*3:n*3+3]
for n in map(int, x)])
for l in c] + [''])
The version I submitted is all on one line and doesn't have the assignment. I just prettied it up for you.
Here's another, better solution.

Comments

Popular posts from this blog

Shortest Sudoku solver in Python

Seven Segment Display in Inkscape

Dot to Png