Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.
Jonathan Gardner
jgardner at jonathangardner.net
Thu Feb 18 17:49:38 EST 2010
On Feb 18, 8:15 am, Steve Howell <showel... at yahoo.com> wrote:
>
> def print_numbers()
> [1, 2, 3, 4, 5, 6].map { |n|
> [n * n, n * n * n]
> }.reject { |square, cube|
> square == 25 || cube == 64
> }.map { |square, cube|
> cube
> }.each { |n|
> puts n
> }
> end
>
If this style of programming were useful, we would all be writing Lisp
today. As it turned out, Lisp is incredibly difficult to read and
understand, even for experienced Lispers. I am pleased that Python is
not following Lisp in that regard.
for n in range(1,6):
square = n*n
cube = n*n*n
if square == 25 or cube == 64: continue
print cube
More information about the Python-list
mailing list