Created
April 26, 2013 23:56
-
-
Save Lucretiel/5471220 to your computer and use it in GitHub Desktop.
That moment when you thought you were programming in Python but it turns out you were actually programming in Lisp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from itertools import imap, ifilter | |
print tuple(reduce( | |
lambda totals, new: imap(lambda x, y: x+y, totals, new), | |
imap( | |
lambda line: imap(int, line.split()[:2]), | |
ifilter( | |
lambda line: line.strip(), | |
sys.stdin)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment