[SciPy-user] RE: weird

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


sorry - ignore me, I've figured it out. It's the indentation on 'elif'
of course! Duh

Dave

-----Original Message-----
From: Howey, David A 
Sent: 14 July 2005 10:44
To: 'SciPy Users List'
Subject: weird

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