DEV Community

Discussion on: [Challenge] 🐝 FizzBuzz without if/else

Collapse
 
evelynsubarrow profile image
Evelyn

py3, oneliner because ofc

fizzbuzz = lambda x: "Fizz"*(x and not x%3)+"Buzz"*(x and not x%5) or str(x)
print([fizzbuzz(n) for n in range(16)])
Collapse
 
jselbie profile image
John Selbie

If it were up to me, I'd declare this the winner.