Previamente, en Adriania…

My mind, she’s blown

I just found a meta-quine.

[...]

Fizzing the Buzz

Here‘s an elegant solution to the FizzBuzz problem done in Python with list comprehensions and the new x if y else z syntax:

print ['FizzBuzz' if not n % 15 else 'Fizz' if not n % 3 else 'Buzz' if not n % 5 else n for n in range(1,101)]

Another list comprehension, this time [...]

Python 3.0 is here

Go check Python.org for the joyful news.

Crear listas de palabras en Perl y Python

Perl y Python tienen dos construcciones idiomáticas para crear una lista de palabras. La de Perl, mucho más conocida, usa el operador qw: qw(foo bar baz quux); En Python, el resultado equivalente se logra con split: “foo bar baz quux”.split()

So now you know.