why it is invalid syntax?

alf ask at me
Thu Nov 22 01:00:16 EST 2007


Hi,

I wonder why it is an invalid syntax:


 >>> if 1: if 1: if 1: print 1
   File "<stdin>", line 1
     if 1: if 1: if 1: print 1


or

 >>> if 1: for i in range(10): print i
   File "<stdin>", line 1
     if 1: for i in range(10): print i

I would expect one could nest :


-- 
alf



More information about the Python-list mailing list