News for hackers. Stuff that matters.
Re:Euler's Fizzbuzz (2020) by uuidgen on Tuesday March 16, 2021 @02:33PM (#26480916)
But there is conditional logic "hidden" in lambda mapping.

You want it without ANY conditional logic try this

(python3): [str(n)*(n%3!=0)*(n%5!=0) + 'Fizz'*(n%3==0) + 'Buzz'*(n%5==0) for n in range(1,101)]

Re:Euler's Fizzbuzz (2020) by chongli on Tuesday March 16, 2021 @03:59PM (#26482062)
There’s tons of hidden conditional logic in the Python string multiplication operator. It’s implemented via the C function unicode_repeat which handles all the conditional logic.
Re:Euler's Fizzbuzz (2020) by uuidgen on Tuesday March 16, 2021 @07:24PM (#26484558)
If you're talking about assembly then every single statement in python will involve hidden conditions.

I was talking about the idea behind the code - that map is a pythonic shorthand for a bunch of if-then statements, it still expresses conditionals. While using string multiplication doesn't.