Using something other than ';' to separate statements

Peter Hansen peter at engcorp.com
Wed Mar 30 15:26:16 EST 2005


Michael Hoffman wrote:
> Jaime Wyant wrote:
> 
>> # This won't work
>> if a > 5: print "a > 5";else print "Doh"
> 
> 
> This will:
> 
> ["Doh", "a > 5"][a > 5]
> 
> I highly discourage using it though--it's somewhat obtuse.

It's also limited to evaluating expressions, which is
probably not very useful to the OP...



More information about the Python-list mailing list