syntax

Fredrik Lundh fredrik at pythonware.com
Fri Jul 30 10:19:22 EDT 1999


Xavier Bec <xav at buf.fr> wrote:
> Why are the double dots ":" necessary after a if, for or while
> instruction ?
> All the others instructions are terminated with a cariage return but not
> condition or loop ones. I know that a semi-column is facultative and
> only used if you have to put a second instruction on the same line. Why
> is not the same for if, etc.
> 
> if i == 10
> print i
> print "test"
> 
> or
> 
> if i == 10 : print i; print "test"
> 
> Any suggestion ?

readability.  think about it for a while, and then read:
http://www.deja.com/=dnc/getdoc.xp?AN=171314015

</F>





More information about the Python-list mailing list