NEWBIE: for statement in "dive into python" gives syntax error.

Mack gugabbe at hotmail.com
Tue Jul 23 15:45:58 EDT 2002


Hi

I need some pointers. I've been reading the "Dive into python" tutorial
and tried some statements on my machine. Redhat 7.1 with python 1.5.2

>>> li = [1, 9, 8, 4]
>>> li
[1, 9, 8, 4]
>>> [elem*2 for elem in li]
  File "<stdin>", line 1
    [elem*2 for elem in li]
              ^
is what i'm getting. Is my python too old? Is something else wrong?
I've just cut and pasted from the tutorial into python ide.

   Mack



More information about the Python-list mailing list