On Feb 18, 8:15 am, Steve Howell <[email protected]> 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
--
http://mail.python.org/mailman/listinfo/python-list