On Mon, Nov 16, 2015 at 10:57 PM,  <harirammanohar...@gmail.com> wrote:
> This would help, but try to write on your own to improve, else you cant make 
> this going long....
>

Here's another version, but with a deliberate bug in it. You may use
this code if and only if your comprehension is sufficient to detect
and correct that bug.

next(filter(None,(print(next(filter(None,reversed(x)))) for x in
enumerate(itertools.islice(itertools.cycle(("Fizzbuzz",0,"","Fizz",not
"Fuzz","Buzz","Fizz",(),bytes(),"Fizz","Buzz",{},"Fizz",False,globals().get(math.pi))),1,101)))),None)

Actually... you know what, I think debugging THAT is a malicious prank
to pull on an experienced Python programmer; plus, if you're caught
submitting that for your project, you deserve all the shame you get.
Trust me, this is NOT good code. Here's the corrected version. It
works, but you do not want to use this.

next(filter(None,(print(next(filter(None,reversed(x)))) for x in
itertools.islice(enumerate(itertools.cycle(("Fizzbuzz",0,"","Fizz",not
"Fuzz","Buzz","Fizz",(),bytes(),"Fizz","Buzz",{},"Fizz",False,globals().get(math.pi)))),1,101))),None)

Enjoy!

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to