String concatenation

Erik Max Francis max at alcyone.com
Fri Apr 2 03:43:19 EST 2004


"Leif B. Kristensen" wrote:

> that looks a lot more like the examples in "Dive Into Python" which
> I'm
> reading at the moment. But the snake won't swallow:
> 
>     tmp = [x for x in res if x and x[0] != '-']
>     ^
> SyntaxError: invalid syntax
> 
> I wonder what it's really trying to tell me?

Probably you included the initial spaces, which is a no-no:

>>> a = 1
>>>    b = 2
  File "<stdin>", line 1
    b = 2
    ^
SyntaxError: invalid syntax

-- 
 __ Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
/  \ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
\__/ They love too much that die for love.
    -- (an English proverb)



More information about the Python-list mailing list