News for hackers. Stuff that matters.
Re:Unpythonic Python by famousactress on Wednesday April 09, 2014 @03:18PM (#7561638)
Here's mine:

['Fizz' * (not bool(i % 3)) + 'Buzz' * (not bool(i % 5)) for i in xrange(1,101) if i % 3 == 0 or i % 5==0]

EDIT: I hate lambdas. Also I'm not saying the above is pretty or a good idea, but I had some fun.

Re:Unpythonic Python by lazyfunctor on Wednesday April 09, 2014 @04:17PM (#7562054)
Mine with some itertools abuse :)

from itertools import cycle , izip

[(f + b or x) for f, b, x in izip(cycle([''] * 2 + ['Fizz']), cycle([''] * 4 + ['Buzz']), range(1, 100))]

Edit: not sure how to post code in comments. e.g. * is lost

Re:Unpythonic Python by ggchappell on Wednesday April 09, 2014 @04:22PM (#7562081)
Nicely done.

> Edit: not sure how to post code in comments. e.g. * is lost

Put a couple of blanks before each line. This displays it in a monospace font, too.