So much for writing my whole program on one line :-(

j/k

-Greg

On 10/26/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
Gregory Piñero wrote:

> Any idea why I can't say:
>
> if 1:print 'a';else:print 'b'
>
> all in one line like that?

because ";" can only be used to separate simple statements, not
the different parts in a compound statement.

see the grammar for details:

    http://docs.python.org/ref/grammar.txt

(look for "compound_stmt", "suite", "statement", etc)

</F>





--
http://mail.python.org/mailman/listinfo/python-list




--
Gregory Piñero
Chief Innovation Officer
Blended Technologies
(www.blendedtechnologies.com)
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to