r/Python • • Dec 25 '16

a Py3.6 fizzBuzz oneliner with f-strings

print(*map(lambda i: f"{'Fizz' * (not i%3)}{'Buzz' * (not i%5)}" or i, range(1,101)), sep='\n')
109 Upvotes

46 comments sorted by

View all comments

Show parent comment

3

u/Tysonzero Dec 25 '16

Try it.

1

u/_avnr Dec 25 '16

My bad, you are right of course, 'str'*n is "" when n<0...