6 ms·
> No disguised booleans Do indexes count? If not, there's a simple one liner def fizzbuzz(n): return [str(n), "fizz", "buzz", "fizzbuzz"][1-min(1,
by sovnwnt 10mo ago
> No disguised booleans
Do indexes count? If not, there's a simple one liner
def fizzbuzz(n):
return [str(n), "fizz", "buzz", "fizzbuzz"][1-min(1, n%3) + (1-min(1,n%5))*2]