Comment

Comment by exDM69

When you write too much Haskell, your Python code starts to look like this:

    print('\n'.join(
        'FizzBuzz' if x%5==0 and x%3==0
        else 'Fizz' if x%3==0
        else 'Buzz' if x%5==0
        else str(x)
        for x in range(1, 101)))
I would really like to have a "let" expression in Python to avoid having to write a new function with a def statement when you could get away with a simple lambda or generator expression.
parent exDM69 12 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton