[SciPy-user] weird

Howey, David A d.howey at imperial.ac.uk
Thu Jul 14 04:44:01 CDT 2005


I'm new to Python, so just working through the tutorials on python.org

The question is, why doesn't this work:

In [34]: if x<0:
   ....:     print 'blah'
   ....:     elif x == 0:
------------------------------------------------------------
   File "<console>", line 3
     elif x == 0:
        ^
SyntaxError: invalid syntax


Surely this is the simplest thing? Does is have a problem with 'elif'?
But it's in the tutorial!!

Dave



More information about the SciPy-user mailing list