Accessing next/prev element while for looping

Max Erickson maxerickson at gmail.com
Sun Dec 18 07:50:20 EST 2005


j> is a built-in object used to make complex numbers. Or at least it
>was, until you rebound it to the current element from myarray. That's bad
>practice, but since using complex numbers is rather unusual, one you will
>probably get away with.

Is it?

>>> j

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in -toplevel-
    j
NameError: name 'j' is not defined
>>> 1 + 2j
(1+2j)
>>> j=4
>>> 1 + 2j
(1+2j)
>>>

I am actually curious, as it doesn't appear to be, but you are usually
'right' when you say such things...

Max




More information about the Python-list mailing list