3 ms·
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']),
by lazyfunctor 12y ago
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
- deleted 12y ago[deleted]
- ggchappell 12y agoNicely 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.
- deleted 12y ago[deleted]