Skip to content

Instantly share code, notes, and snippets.

@nkoneko
Last active August 29, 2015 13:57
Show Gist options
  • Save nkoneko/9669627 to your computer and use it in GitHub Desktop.
Save nkoneko/9669627 to your computer and use it in GitHub Desktop.
import itertools as I
import functools as F
FROM=1
TO=32
_=lambda m,f,g:I.cycle(I.chain(I.repeat(g,m-1),[f]))
_id=lambda x:x
_fizz=lambda x:x+'Fizz'
_bazz=lambda x:x+'Bazz'
fs=_(3,_fizz,_id)
bs=_(5,_bazz,_id)
__=lambda i,x:x if x else i
for c in I.islice((__(_i,b(f(''))) for (_i,f,b) in I.izip(I.count(1),fs,bs)),FROM-1,TO):
c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment