Python Rocks!

Mikael Olofsson mikael at isy.liu.se
Thu Jan 20 04:34:52 EST 2000


On 19-Jan-00 tye4 wrote:
 >  Perfect example.
 >     if (a > 3)
 >       if (b == 4)
 >          c = 2;
 >      else
 >       c = 3;
 >  
 >  If you add a space, the 'else' will belong to the inner 'if'. If you delete
 >  one, the 'else' will belong to the outer one. Highly error prone.

I would say error detection capability. The Python interpreter detects the 
problem and reports it. 

 >  if x = 5:
 >      print 'x is 5'
 >  end if

Hmm. Repetition is the mother of all knowledge:

if x = 5:
    print 'x is 5'
#end if

is even more backwards compatible, because it has worked ever since
comments were introduced.

/Mikael

-----------------------------------------------------------------------
E-Mail:  Mikael Olofsson <mikael at isy.liu.se>
WWW:     http://www.dtr.isy.liu.se/dtr/staff/mikael
Phone:   +46 - (0)13 - 28 1343
Telefax: +46 - (0)13 - 28 1339
Date:    20-Jan-00
Time:    10:28:15

This message was sent by XF-Mail.
-----------------------------------------------------------------------



More information about the Python-list mailing list