qbradq wrote:
Python FTW :D
Code:
interleaved = "".join( i for j in zip( even, odd ) for i in j )
i for j in zip() for i in jSurely I can't be the only one looking at that going "what the fuck?" So the next time someone tells me Perl is hard to read, I'm going to point them to that line there. I had a discussion with a fellow programmer last night about that line; he broke it down for me (which helped make more sense out of it), and stated boldly in agreement that yes the syntax is utterly retarded. For those still unable to comprehend the clusterfuck, quoting my peer:
Quote:
you have to read it kind of funny. it's equivalent to
Code:
for j in zip(even, odd):
for i in j:
i
the return values get built up into an unnamed list, which becomes the argument to join. the syntax is dumb but the concept is really simple
http://wemeantwell.com/blog/wp-content/ ... up_ass.jpg