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

Reply via email to