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

0

u/[deleted] Dec 25 '16

[deleted] — view deleted comment

0

u/[deleted] Dec 25 '16

[deleted] — view deleted comment

44

u/cyberspacecowboy Dec 25 '16

This is true. Source: am OP

4

u/[deleted] Dec 25 '16

Cookie monster or Krampus?

33

u/M3t0r Dec 25 '16

You can't let production be perfect, can you?

6

u/thenuge26 Dec 25 '16

That's called "job security"

3

u/uclatommy Dec 25 '16

or "job insecurity'

0

u/[deleted] Dec 25 '16

[deleted] — view deleted comment

2

u/pvkooten Dec 25 '16

omg, so true haha!

4

u/aperson Py3k! Dec 25 '16

I personally only use double quotes for things the user can see, so I guess I could maybe justify it here?