Using something other than ';' to separate statements

Michael Hoffman cam.ac.uk at mh391.invalid
Wed Mar 30 15:12:25 EST 2005


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.
-- 
Michael Hoffman



More information about the Python-list mailing list