Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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]


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: